diff --git a/mods/tinker/resources/lang/en_US.xml b/mods/tinker/resources/lang/en_US.xml index d9fd8bb0..d64f8ea4 100644 --- a/mods/tinker/resources/lang/en_US.xml +++ b/mods/tinker/resources/lang/en_US.xml @@ -59,6 +59,34 @@ Aluminum Oreberry Silver Oreberry + Paper Stack + Slime Crystal + Seared Brick + Cobalt Ingot + Ardite Ingot + Manyullyn Ingot + Ball of Moss + Lava Crystal + Necrotic Bone" + Copper Ingot + Tin Ingot + Aluminum Ingot + Raw Aluminum + Bronze Ingot + Aluminum Brass Ingot + Alumite Ingot + Steel Ingot + Slime Crystal + Obsidian Ingot + Iron Nugget + Copper Nugget + Tin Nugget + Aluminum Nugget + Silver Nugget + Aluminum Brass Nugget + Silky Cloth + Silky Jewel + Smeltery Controller Smeltery Drain Seared Bricks @@ -112,7 +140,7 @@ Liquid Cobalt Liquid Ardite Liquid Bronze - Liquid Aluminum Brass + Liquid Aluminum Brass Liquid Manyullyn Liquid Alumite Liquid Obsidian diff --git a/mods/tinker/resources/manuals/materials.xml b/mods/tinker/resources/manuals/materials.xml index e0f85743..08e7ac71 100644 --- a/mods/tinker/resources/manuals/materials.xml +++ b/mods/tinker/resources/manuals/materials.xml @@ -524,6 +524,7 @@ Effects: - Smelts blocks as they're harvested - Sets mobs on fire for 3 seconds - Stacks with Luck +- Not compatible with Silky Type: Multi-use Stackable: No @@ -542,6 +543,7 @@ Effects: - Adds fortune or looting, depends on tool type - Increases level at a maximum threshold, but has a chance of increasing before - Sometimes adds extra pieces for free +- Not compatible with Silky Type: Single-use Stackable: No @@ -603,6 +605,39 @@ Stackable: Yes necroticmod + +Silky +Adding a large glob of alunimum brass or gold and a bunch of string seems to give the tool silky-smooth properties. + +Effects: +- Allows blocks to be harvested directly +- Not compatible with Luck or Auto-Smelt + +Type: Single-use +Stackable: No + + + +tool +silkymod + + + +Silky Cloth + + silkycloth + three + + + + +Silky Jewel + + silkyjewel + three + + + Electric Adding a battery and a circuit to a tool gives it an electric field. The tool still functions properly when the battery has no charge. diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index 4b5c5657..24b6e52a 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -32,10 +32,10 @@ import cpw.mods.fml.common.registry.VillagerRegistry; /** TConstruct, the tool mod. * Craft your tools with style, then modify until the original is gone! * @author: mDiyo - * @dependencies: IC2 API, EBXL API + * @dependencies: IC2 API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev31", dependencies = "required-after:Forge@[7.7.1.675,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev33", dependencies = "required-after:Forge@[7.7.1.675,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class) public class TConstruct { diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index 687c2f83..b81e071a 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -302,6 +302,7 @@ public class TProxyClient extends TProxyCommon TConstructClientRegistry.registerManualIcon("arditeingot", new ItemStack(TContent.materials, 1, 4)); TConstructClientRegistry.registerManualIcon("copperingot", new ItemStack(TContent.materials, 1, 9)); TConstructClientRegistry.registerManualIcon("steelingot", new ItemStack(TContent.materials, 1, 16)); + //Tool parts TConstructClientRegistry.registerManualIcon("pickhead", new ItemStack(TContent.pickaxeHead, 1, 2)); @@ -366,6 +367,9 @@ public class TProxyClient extends TProxyCommon ItemStack slimyMud = new ItemStack(TContent.craftedSoil); ItemStack blazerod = new ItemStack(Item.blazeRod); ItemStack firecharge = new ItemStack(Item.fireballCharge); + ItemStack string = new ItemStack(Item.silk); + + ItemStack silkyCloth = new ItemStack(TContent.materials, 1, 25); //TConstruct recipes TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank); @@ -381,6 +385,10 @@ public class TProxyClient extends TProxyCommon mossycobble, mossycobble, mossycobble); TConstructClientRegistry.registerManualLargeRecipe("lavacrystal", new ItemStack(TContent.materials, 1, 7), blazerod, firecharge, blazerod, firecharge, new ItemStack(Item.bucketLava), firecharge, blazerod, firecharge, blazerod); + TConstructClientRegistry.registerManualLargeRecipe("silkycloth", silkyCloth, string, string, string, string, new ItemStack(TContent.materials, 1, 24), + string, string, string, string); + TConstructClientRegistry.registerManualLargeRecipe("silkyjewel", new ItemStack(TContent.materials, 1, 26), null, silkyCloth, null, silkyCloth, new ItemStack(Item.emerald), + silkyCloth, null, silkyCloth, null); TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay); TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout); @@ -418,6 +426,7 @@ public class TProxyClient extends TProxyCommon TConstructClientRegistry.registerManualModifier("quartzmod", ironlongsword.copy(), new ItemStack(Item.netherQuartz), new ItemStack(Block.blockNetherQuartz)); TConstructClientRegistry.registerManualModifier("blazemod", ironlongsword.copy(), new ItemStack(Item.blazePowder)); TConstructClientRegistry.registerManualModifier("necroticmod", ironlongsword.copy(), new ItemStack(TContent.materials, 1, 8)); + TConstructClientRegistry.registerManualModifier("silkymod", ironpick.copy(), new ItemStack(TContent.materials, 1, 26)); TConstructClientRegistry.registerManualModifier("electricmod", ironpick.copy(), new ItemStack(Block.dirt), new ItemStack(Block.dirt)); TConstructClientRegistry.registerManualModifier("tier1free", ironpick.copy(), new ItemStack(Item.diamond), new ItemStack(Block.blockGold)); TConstructClientRegistry.registerManualModifier("tier2free", ironpick.copy(), new ItemStack(Item.netherStar)); @@ -517,12 +526,12 @@ public class TProxyClient extends TProxyCommon { String[] partTypes = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel", "blueslime" }; - String[] effectTypes = { "diamond", "emerald", "redstone", "glowstone", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz" }; - int[] validHarvestEffects = { 0, 1, 2, 4, 6, 7, 8, 9, 10, 11 }; - int[] validWeaponEffects = { 0, 1, 4, 5, 6, 7, 8, 9, 10, 11}; + String[] effectTypes = { "diamond", "emerald", "redstone", "glowstone", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz", "silk" }; + int[] validHarvestEffects = { 0, 1, 2, 4, 6, 7, 8, 9, 10, 11, 12 }; + int[] validWeaponEffects = { 0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; int[] validUtilityEffects = { 0, 1, 4, 9 }; - int[] validDaggerEffects = { 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11}; + int[] validDaggerEffects = { 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; for (int partIter = 0; partIter < partTypes.length; partIter++) { diff --git a/mods/tinker/tconstruct/common/TContent.java b/mods/tinker/tconstruct/common/TContent.java index d5e2b7c0..c77b11e5 100644 --- a/mods/tinker/tconstruct/common/TContent.java +++ b/mods/tinker/tconstruct/common/TContent.java @@ -36,6 +36,7 @@ import mods.tinker.tconstruct.items.CraftingItem; import mods.tinker.tconstruct.items.FilledBucket; import mods.tinker.tconstruct.items.HeartContainer; import mods.tinker.tconstruct.items.Manual; +import mods.tinker.tconstruct.items.MaterialItem; import mods.tinker.tconstruct.items.MetalPattern; import mods.tinker.tconstruct.items.OreBerries; import mods.tinker.tconstruct.items.Pattern; @@ -77,8 +78,9 @@ import mods.tinker.tconstruct.library.crafting.ToolBuilder; import mods.tinker.tconstruct.library.tools.ToolCore; import mods.tinker.tconstruct.library.util.IPattern; import mods.tinker.tconstruct.modifiers.ModAttack; +import mods.tinker.tconstruct.modifiers.ModAutoSmelt; import mods.tinker.tconstruct.modifiers.ModBlaze; -import mods.tinker.tconstruct.modifiers.ModBoolean; +import mods.tinker.tconstruct.modifiers.ModButtertouch; import mods.tinker.tconstruct.modifiers.ModDurability; import mods.tinker.tconstruct.modifiers.ModElectric; import mods.tinker.tconstruct.modifiers.ModExtraModifier; @@ -374,15 +376,7 @@ public class TContent implements IFuelHandler String[] blanks = new String[] { "blank_pattern", "blank_cast" }; blankPattern = new CraftingItem(PHConstruct.blankPattern, blanks, blanks, "materials/").setUnlocalizedName("tconstruct.Pattern"); - String[] craftingMaterials = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone", - "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot", "IronNugget", - "CopperNugget", "TinNugget", "AluminumNugget", "SilverNugget" }; - String[] craftingTextures = new String[] { "material_paperstack", "material_slimecrystal", "material_searedbrick", "material_cobaltingot", "material_arditeingot", "material_manyullyningot", - "material_mossball", "material_lavacrystal", "material_necroticbone", "material_copperingot", "material_tiningot", "material_aluminumingot", "material_aluminumraw", - "material_bronzeingot", "material_alubrassingot", "material_alumiteingot", "material_steelingot", "material_blueslimecrystal", "material_obsidianingot", "material_nugget_iron", - "material_nugget_copper", "material_nugget_tin", "material_nugget_aluminum", "material_nugget_silver" }; - - materials = new CraftingItem(PHConstruct.materials, craftingMaterials, craftingTextures, "materials/").setUnlocalizedName("tconstruct.Materials"); + materials = new MaterialItem(PHConstruct.materials).setUnlocalizedName("tconstruct.Materials"); toolRod = new ToolPart(PHConstruct.toolRod, "ToolRod", "_rod").setUnlocalizedName("tconstruct.ToolRod"); TConstructRegistry.toolRod = toolRod; toolShard = new ToolShard(PHConstruct.toolShard, "ToolShard", "_chunk").setUnlocalizedName("tconstruct.ToolShard"); @@ -578,7 +572,7 @@ public class TContent implements IFuelHandler 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 ModBoolean(new ItemStack[] { new ItemStack(materials, 1, 7) }, 6, "Lava", "\u00a74", "Auto-Smelt")); + tb.registerToolMod(new ModAutoSmelt(new ItemStack[] { new ItemStack(materials, 1, 7) }, 6, "Lava", "\u00a74", "Auto-Smelt")); tb.registerToolMod(new ModInteger(new ItemStack[] { new ItemStack(materials, 1, 8) }, 8, "Necrotic", 1, "\u00a78", "Life Steal")); ItemStack quartzItem = new ItemStack(Item.netherQuartz); @@ -591,6 +585,9 @@ public class TContent implements IFuelHandler tb.registerToolMod(new ModExtraModifier(new ItemStack[] { diamond, new ItemStack(Block.blockGold) }, "Tier1Free")); tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Item.netherStar) }, "Tier2Free")); + + ItemStack silkyJewel = new ItemStack(materials, 1, 26); + tb.registerToolMod(new ModButtertouch(new ItemStack[] {silkyJewel}, 12)); /* Smeltery */ ItemStack ingotcast = new ItemStack(metalPattern, 1, 0); @@ -745,6 +742,10 @@ public class TContent implements IFuelHandler FurnaceRecipes.smelting().addSmelting(craftedSoil.blockID, 1, new ItemStack(materials, 1, 2), 2f); //Seared brick item FurnaceRecipes.smelting().addSmelting(craftedSoil.blockID, 2, new ItemStack(materials, 1, 17), 2f); //Blue Slime //GameRegistry.addRecipe(new ItemStack(oreSlag, 1, 0), "pp", "pp", 'p', new ItemStack(materials, 1, 2)); //Seared brick block + + GameRegistry.addRecipe(new ItemStack(materials, 1, 25), "sss", "sns", "sss", 'n', new ItemStack(materials, 1, 24), 's', new ItemStack(Item.silk)); //Silky Cloth + GameRegistry.addRecipe(new ItemStack(materials, 1, 25), "sss", "sns", "sss", 'n', new ItemStack(Item.goldNugget), 's', new ItemStack(Item.silk)); + GameRegistry.addRecipe(new ItemStack(materials, 1, 26), " c ", "cec", " c ", 'c', new ItemStack(materials, 1, 25), 'e', new ItemStack(Item.emerald)); //Silky Jewel //FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 1, new ItemStack(materials, 1, 3), 3f); //FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 2, new ItemStack(materials, 1, 4), 3f); @@ -783,6 +784,12 @@ public class TContent implements IFuelHandler GameRegistry.addRecipe(new ItemStack(materials, 1, 9), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 20)); //Copper GameRegistry.addRecipe(new ItemStack(materials, 1, 10), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 21)); //Tin GameRegistry.addRecipe(new ItemStack(materials, 1, 12), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 22)); //Aluminum + GameRegistry.addRecipe(new ItemStack(materials, 1, 14), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 24)); //Aluminum Brass + + GameRegistry.addRecipe(new ItemStack(materials, 9, 24), "m", 'm', new ItemStack(materials, 1, 14)); //Aluminum Brass Nugget + + /*OreDictionary.registerOre("ingotAluminumBrass", new ItemStack(materials, 1, 14)); + OreDictionary.registerOre("nuggetAluminumBrass", new ItemStack(materials, 1, 24));*/ //Smeltery ItemStack searedBrick = new ItemStack(materials, 1, 2); @@ -870,6 +877,7 @@ public class TContent implements IFuelHandler OreDictionary.registerOre("nuggetTin", new ItemStack(materials, 1, 21)); OreDictionary.registerOre("nuggetNaturalAluminum", new ItemStack(materials, 1, 22)); OreDictionary.registerOre("nuggetSilver", new ItemStack(materials, 1, 23)); + OreDictionary.registerOre("nuggetAluminumBrass", new ItemStack(materials, 1, 24)); String[] names = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "Brass", "Manyullyn", "Alumite", "Obsidian", "Steel" }; liquidIcons = new LiquidStack[names.length]; diff --git a/mods/tinker/tconstruct/common/TProxyCommon.java b/mods/tinker/tconstruct/common/TProxyCommon.java index 37aaf6cc..a230c844 100644 --- a/mods/tinker/tconstruct/common/TProxyCommon.java +++ b/mods/tinker/tconstruct/common/TProxyCommon.java @@ -104,12 +104,12 @@ public class TProxyCommon implements IGuiHandler LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); } - for (int i = 0; i < materialItemNames.length; i++) + /*for (int i = 0; i < materialItemNames.length; i++) { String internalName = "item.tconstruct.Materials." + materialItemInternalNames[i] + ".name"; String visibleName = materialItemNames[i]; LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); - } + }*/ for (int i = 0; i < patterns.length; i++) { @@ -162,13 +162,13 @@ public class TProxyCommon implements IGuiHandler public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard", "Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk", "Slime Crystal Fragment" }; - public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", - "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot", "IronNugget", + /*public static final String[] materialItemInternalNames = new String[] { + "IronNugget", "CopperNugget", "TinNugget", "AluminumNugget", "SilverNugget" }; - public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal", - "Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot", "Slime Crystal", "Obsidian Ingot", "Iron Nugget", - "Copper Nugget", "Tin Nugget", "Aluminum Nugget", "Silver Nugget" }; + public static final String[] materialItemNames = new String[] { + "Iron Nugget", + "Copper Nugget", "Tin Nugget", "Aluminum Nugget", "Silver Nugget" };*/ public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Alumite", "Steel", "Blue Slime" }; diff --git a/mods/tinker/tconstruct/entity/NitroCreeper.java b/mods/tinker/tconstruct/entity/NitroCreeper.java index ff295cda..209d2ee5 100644 --- a/mods/tinker/tconstruct/entity/NitroCreeper.java +++ b/mods/tinker/tconstruct/entity/NitroCreeper.java @@ -24,6 +24,7 @@ public class NitroCreeper extends EntityCreeper super(world); this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0F, false)); this.texture = "/mods/tinker/textures/mob/creeperunstable.png"; + this.isImmuneToFire = true; } /*@Override diff --git a/mods/tinker/tconstruct/items/MaterialItem.java b/mods/tinker/tconstruct/items/MaterialItem.java new file mode 100644 index 00000000..541cc54d --- /dev/null +++ b/mods/tinker/tconstruct/items/MaterialItem.java @@ -0,0 +1,27 @@ +package mods.tinker.tconstruct.items; + +public class MaterialItem extends CraftingItem +{ + + public MaterialItem(int id) + { + super(id, materialNames, getTextures(), "materials/"); + } + + private static String[] getTextures () + { + String[] names = new String[craftingTextures.length]; + for (int i = 0; i < craftingTextures.length; i++) + names[i] = "material_" + craftingTextures[i]; + return names; + } + + static String[] materialNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone", + "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AluBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot", "IronNugget", "CopperNugget", + "TinNugget", "AluminumNugget", "SilverNugget", "AluBrassNugget", "SilkyCloth", "SilkyJewel" }; + + static String[] craftingTextures = new String[] { "paperstack", "slimecrystal", "searedbrick", "cobaltingot", "arditeingot", "manyullyningot", "mossball", "lavacrystal", "necroticbone", + "copperingot", "tiningot", "aluminumingot", "aluminumraw", "bronzeingot", "alubrassingot", "alumiteingot", "steelingot", "blueslimecrystal", "obsidianingot", "nugget_iron", + "nugget_copper", "nugget_tin", "nugget_aluminum", "nugget_silver", "nugget_alubrass", "silkycloth", "silkyjewel" }; + +} diff --git a/mods/tinker/tconstruct/modifiers/ModAutoSmelt.java b/mods/tinker/tconstruct/modifiers/ModAutoSmelt.java new file mode 100644 index 00000000..dc8ab60d --- /dev/null +++ b/mods/tinker/tconstruct/modifiers/ModAutoSmelt.java @@ -0,0 +1,23 @@ +package mods.tinker.tconstruct.modifiers; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class ModAutoSmelt extends ModBoolean +{ + + public ModAutoSmelt(ItemStack[] items, int effect, String tag, String c, String tip) + { + super(items, effect, tag, c, tip); + } + + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Silk Touch")) + return false; + return tags.getInteger("Modifiers") > 0 && !tags.getBoolean(key); //Will fail if the modifier is false or the tag doesn't exist + } + +} diff --git a/mods/tinker/tconstruct/modifiers/ModButtertouch.java b/mods/tinker/tconstruct/modifiers/ModButtertouch.java new file mode 100644 index 00000000..4bd069d2 --- /dev/null +++ b/mods/tinker/tconstruct/modifiers/ModButtertouch.java @@ -0,0 +1,117 @@ +package mods.tinker.tconstruct.modifiers; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.library.tools.ToolMod; +import mods.tinker.tconstruct.library.tools.Weapon; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class ModButtertouch extends ModBoolean +{ + + public ModButtertouch(ItemStack[] items, int effect) + { + super(items, effect, "Silk Touch", "\u00a7e", "Silky"); + } + + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + ToolCore toolItem = (ToolCore) tool.getItem(); + if (!validType(toolItem)) + return false; + + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (!tags.getBoolean("Lava") && !tags.hasKey("Lapis")) + { + return tags.getInteger("Modifiers") > 0 && !tags.getBoolean(key); + } + return false; + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + tags.setBoolean(key, true); + addEnchantment(tool, Enchantment.silkTouch, 1); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + + int attack = tags.getInteger("Attack"); + attack -= 3; + if (attack < 0) + attack = 0; + tags.setInteger("Attack", attack); + + int miningSpeed = tags.getInteger("MiningSpeed"); + miningSpeed -= 300; + if (miningSpeed < 0) + miningSpeed = 0; + tags.setInteger("MiningSpeed", miningSpeed); + + if (tags.hasKey("MiningSpeed2")) + { + int miningSpeed2 = tags.getInteger("MiningSpeed2"); + miningSpeed2 -= 300; + if (miningSpeed2 < 0) + miningSpeed2 = 0; + tags.setInteger("MiningSpeed2", miningSpeed2); + } + + addToolTip(tool, color+tooltipName, color+key); + } + + public void addEnchantment (ItemStack tool, Enchantment enchant, int level) + { + NBTTagList tags = new NBTTagList("ench"); + Map enchantMap = EnchantmentHelper.getEnchantments(tool); + Iterator iterator = enchantMap.keySet().iterator(); + int index; + int lvl; + boolean hasEnchant = false; + while (iterator.hasNext()) + { + NBTTagCompound enchantTag = new NBTTagCompound(); + index = ((Integer) iterator.next()).intValue(); + lvl = (Integer) enchantMap.get(index); + if (index == enchant.effectId) + { + hasEnchant = true; + enchantTag.setShort("id", (short) index); + enchantTag.setShort("lvl", (short) ((byte) level)); + tags.appendTag(enchantTag); + } + else + { + enchantTag.setShort("id", (short) index); + enchantTag.setShort("lvl", (short) ((byte) lvl)); + tags.appendTag(enchantTag); + } + } + if (!hasEnchant) + { + NBTTagCompound enchantTag = new NBTTagCompound(); + enchantTag.setShort("id", (short) enchant.effectId); + enchantTag.setShort("lvl", (short) ((byte) level)); + tags.appendTag(enchantTag); + } + tool.stackTagCompound.setTag("ench", tags); + } + + public boolean validType (ToolCore tool) + { + List list = Arrays.asList(tool.toolCategories()); + return list.contains("weapon") || list.contains("harvest"); + } +} diff --git a/mods/tinker/tconstruct/modifiers/ModLapis.java b/mods/tinker/tconstruct/modifiers/ModLapis.java index 6e5a71ab..0cc9e7f4 100644 --- a/mods/tinker/tconstruct/modifiers/ModLapis.java +++ b/mods/tinker/tconstruct/modifiers/ModLapis.java @@ -35,6 +35,10 @@ public class ModLapis extends ToolMod return false; NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + if (tags.getBoolean("Silk Touch")) + return false; + if (!tags.hasKey(key)) return tags.getInteger("Modifiers") > 0; diff --git a/mods/tinker/tconstruct/util/TEventHandler.java b/mods/tinker/tconstruct/util/TEventHandler.java index dfa2f773..ce3a7dcb 100644 --- a/mods/tinker/tconstruct/util/TEventHandler.java +++ b/mods/tinker/tconstruct/util/TEventHandler.java @@ -81,23 +81,26 @@ public class TEventHandler @ForgeSubscribe public void onLivingDrop (LivingDropsEvent event) { - if (event.entityLiving.getClass() == EntityCow.class) + if (!event.entityLiving.isChild()) { - int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1; - - for (int iter = 0; iter < amount; ++iter) + if (event.entityLiving.getClass() == EntityCow.class) { - event.entityLiving.dropItem(Item.leather.itemID, 1); + int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1; + + for (int iter = 0; iter < amount; ++iter) + { + event.entityLiving.dropItem(Item.leather.itemID, 1); + } } - } - else if (event.entityLiving.getClass() == EntityChicken.class) - { - int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1; - - for (int iter = 0; iter < amount; ++iter) + else if (event.entityLiving.getClass() == EntityChicken.class) { - event.entityLiving.dropItem(Item.feather.itemID, 1); + int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1; + + for (int iter = 0; iter < amount; ++iter) + { + event.entityLiving.dropItem(Item.feather.itemID, 1); + } } } diff --git a/mods/tinker/tconstruct/worldgen/village/VillageSmelteryHandler.java b/mods/tinker/tconstruct/worldgen/village/VillageSmelteryHandler.java index ce461ff4..e1afe509 100644 --- a/mods/tinker/tconstruct/worldgen/village/VillageSmelteryHandler.java +++ b/mods/tinker/tconstruct/worldgen/village/VillageSmelteryHandler.java @@ -13,7 +13,7 @@ public class VillageSmelteryHandler implements IVillageCreationHandler @Override public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i) { - return new StructureVillagePieceWeight(ComponentSmeltery.class, 18, i); + return new StructureVillagePieceWeight(ComponentSmeltery.class, 18, i + 1); } @Override diff --git a/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java b/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java index 98922f7f..be951ec3 100644 --- a/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java +++ b/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java @@ -13,7 +13,7 @@ public class VillageToolStationHandler implements IVillageCreationHandler @Override public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i) { - return new StructureVillagePieceWeight(ComponentToolWorkshop.class, 30, random.nextInt(3) + i); + return new StructureVillagePieceWeight(ComponentToolWorkshop.class, 30, i + 2); } @Override diff --git a/mods/tinker/textures/items/axe/silk_axe_effect.png b/mods/tinker/textures/items/axe/silk_axe_effect.png new file mode 100644 index 00000000..22ffb7db Binary files /dev/null and b/mods/tinker/textures/items/axe/silk_axe_effect.png differ diff --git a/mods/tinker/textures/items/battlesign/silk_battlesign_effect.png b/mods/tinker/textures/items/battlesign/silk_battlesign_effect.png new file mode 100644 index 00000000..33658a16 Binary files /dev/null and b/mods/tinker/textures/items/battlesign/silk_battlesign_effect.png differ diff --git a/mods/tinker/textures/items/broadsword/silk_sword_effect.png b/mods/tinker/textures/items/broadsword/silk_sword_effect.png new file mode 100644 index 00000000..774f7b3e Binary files /dev/null and b/mods/tinker/textures/items/broadsword/silk_sword_effect.png differ diff --git a/mods/tinker/textures/items/dagger/silk_dagger_effect.png b/mods/tinker/textures/items/dagger/silk_dagger_effect.png new file mode 100644 index 00000000..8b397581 Binary files /dev/null and b/mods/tinker/textures/items/dagger/silk_dagger_effect.png differ diff --git a/mods/tinker/textures/items/frypan/silk_frypan_effect.png b/mods/tinker/textures/items/frypan/silk_frypan_effect.png new file mode 100644 index 00000000..5ca60417 Binary files /dev/null and b/mods/tinker/textures/items/frypan/silk_frypan_effect.png differ diff --git a/mods/tinker/textures/items/longsword/silk_longsword_effect.png b/mods/tinker/textures/items/longsword/silk_longsword_effect.png new file mode 100644 index 00000000..ec21a744 Binary files /dev/null and b/mods/tinker/textures/items/longsword/silk_longsword_effect.png differ diff --git a/mods/tinker/textures/items/materials/material_nugget_alubrass.png b/mods/tinker/textures/items/materials/material_nugget_alubrass.png new file mode 100644 index 00000000..4f7617e7 Binary files /dev/null and b/mods/tinker/textures/items/materials/material_nugget_alubrass.png differ diff --git a/mods/tinker/textures/items/materials/material_silkycloth.png b/mods/tinker/textures/items/materials/material_silkycloth.png new file mode 100644 index 00000000..aa966581 Binary files /dev/null and b/mods/tinker/textures/items/materials/material_silkycloth.png differ diff --git a/mods/tinker/textures/items/materials/material_silkyjewel.png b/mods/tinker/textures/items/materials/material_silkyjewel.png new file mode 100644 index 00000000..a2bfbc04 Binary files /dev/null and b/mods/tinker/textures/items/materials/material_silkyjewel.png differ diff --git a/mods/tinker/textures/items/mattock/silk_mattock_effect.png b/mods/tinker/textures/items/mattock/silk_mattock_effect.png new file mode 100644 index 00000000..0d07905c Binary files /dev/null and b/mods/tinker/textures/items/mattock/silk_mattock_effect.png differ diff --git a/mods/tinker/textures/items/pickaxe/silk_pickaxe_effect.png b/mods/tinker/textures/items/pickaxe/silk_pickaxe_effect.png new file mode 100644 index 00000000..97976688 Binary files /dev/null and b/mods/tinker/textures/items/pickaxe/silk_pickaxe_effect.png differ diff --git a/mods/tinker/textures/items/rapier/silk_rapier_effect.png b/mods/tinker/textures/items/rapier/silk_rapier_effect.png new file mode 100644 index 00000000..ec3ce12f Binary files /dev/null and b/mods/tinker/textures/items/rapier/silk_rapier_effect.png differ diff --git a/mods/tinker/textures/items/shovel/silk_shovel_effect.png b/mods/tinker/textures/items/shovel/silk_shovel_effect.png new file mode 100644 index 00000000..3fcc87fd Binary files /dev/null and b/mods/tinker/textures/items/shovel/silk_shovel_effect.png differ diff --git a/spritesheets/axes.png b/spritesheets/axes.png index 539d2cce..3f96b352 100644 Binary files a/spritesheets/axes.png and b/spritesheets/axes.png differ diff --git a/spritesheets/battlesigns.png b/spritesheets/battlesigns.png index d57a8403..b735b51c 100644 Binary files a/spritesheets/battlesigns.png and b/spritesheets/battlesigns.png differ diff --git a/spritesheets/daggers.png b/spritesheets/daggers.png index 432fb351..50089c53 100644 Binary files a/spritesheets/daggers.png and b/spritesheets/daggers.png differ diff --git a/spritesheets/frypans.png b/spritesheets/frypans.png index 5b342cbe..4c1b9ee1 100644 Binary files a/spritesheets/frypans.png and b/spritesheets/frypans.png differ diff --git a/spritesheets/mattock.png b/spritesheets/mattock.png index 0a2b3139..4fa0634a 100644 Binary files a/spritesheets/mattock.png and b/spritesheets/mattock.png differ diff --git a/spritesheets/pickaxes.png b/spritesheets/pickaxes.png index eefeb61b..56f61741 100644 Binary files a/spritesheets/pickaxes.png and b/spritesheets/pickaxes.png differ diff --git a/spritesheets/shovels.png b/spritesheets/shovels.png index 25c82a4d..2fc25f30 100644 Binary files a/spritesheets/shovels.png and b/spritesheets/shovels.png differ diff --git a/spritesheets/swordbroad.png b/spritesheets/swordbroad.png index 77a1bb04..f6f6d544 100644 Binary files a/spritesheets/swordbroad.png and b/spritesheets/swordbroad.png differ diff --git a/spritesheets/swordlong.png b/spritesheets/swordlong.png index 173a4d38..298c2fd1 100644 Binary files a/spritesheets/swordlong.png and b/spritesheets/swordlong.png differ diff --git a/spritesheets/swordrapier.png b/spritesheets/swordrapier.png index 4ac7695d..a8fe5588 100644 Binary files a/spritesheets/swordrapier.png and b/spritesheets/swordrapier.png differ diff --git a/test/XinBuilder.java b/test/XinBuilder.java index f35364b4..a870fe4b 100644 --- a/test/XinBuilder.java +++ b/test/XinBuilder.java @@ -131,11 +131,7 @@ public class XinBuilder extends Item float f6 = MathHelper.sin(-f1 * 0.017453292F); float f7 = f4 * f5; float f8 = f3 * f5; - double d3 = 500.0D; - if (par2EntityPlayer instanceof EntityPlayerMP) - { - d3 = ((EntityPlayerMP) par2EntityPlayer).theItemInWorldManager.getBlockReachDistance(); - } + double d3 = 500.0D; //Max range Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); }