Goodbye old original Iguana Tweaks code

This commit is contained in:
Bernhard Bonigl committed 2014-08-24 22:13:28 +02:00
1 parent f1cda47334
commit 6559fd30cc
44 files changed
-5629

No files matched your search

@@ -1,50 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import cpw.mods.fml.common.registry.GameRegistry;
import iguanaman.iguanatweakstconstruct.old.blocks.IguanaToolForgeBlock;
import iguanaman.iguanatweakstconstruct.old.blocks.IguanaToolStationBlock;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import tconstruct.common.itemblocks.MetadataItemBlock;
import tconstruct.tools.TinkerTools;
import tconstruct.tools.itemblocks.ToolStationItemBlock;
public class IguanaBlocks {
public static Block gravelNew;
public static Block newSkullBlock;
public static Block iguanaToolStationWood;
public static void init()
{
//TOOL STATION + FORGE
Log.info("Modifying GUIs");
TinkerTools.toolStationWood = null;
TinkerTools.toolStationWood = new IguanaToolStationBlock(Material.wood).setBlockName("ToolStation");
GameRegistry.registerBlock(TinkerTools.toolStationWood, ToolStationItemBlock.class, "ToolStationBlock");
TinkerTools.toolForge = null;
TinkerTools.toolForge = new IguanaToolForgeBlock(Material.iron).setBlockName("ToolForge");
GameRegistry.registerBlock(TinkerTools.toolForge, MetadataItemBlock.class, "ToolForgeBlock");
//TinkerWorld.oreGravel = null;
//TinkerWorld.oreGravel = new IguanaGravelOre().setBlockName("tconstruct.gravelore");
//GameRegistry.registerBlock(TinkerWorld.oreGravel, GravelOreItem.class, "GravelOre");
//SKULLS
Log.info("Adding skullItem blocks");
// TODO: Find a way to change vanilla skulls
/*Blocks.skullItem = null;
newSkullBlock = new IguanaBlockSkull().setHardness(1.0F).setStepSound(Block.soundTypeSand).setBlockName("skullItem").setBlockTextureName("skullItem");
Blocks.skullItem = newSkullBlock;
GameRegistry.registerBlock(newSkullBlock, "Skull");
GameRegistry.registerTileEntity(IguanaTileEntitySkull.class, "SkullEntity");*/
}
}
@@ -1,25 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
public class IguanaClientEventHandler {
/* Sounds */
@SubscribeEvent
public void onSound (SoundLoadEvent event)
{
try
{
//event.manager.addSound("iguanatweakstconstruct:chime.ogg");
FMLLog.warning("IguanaTweaksTConstruct: Loaded chime sound");
}
catch (Exception e)
{
FMLLog.warning("IguanaTweaksTConstruct: Failed to load chime sound");
}
}
}
@@ -1,589 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class IguanaConfig {
// Item Ids
/*
public static int clayBucketLavaId;
public static int clayBucketMilkId;
public static int clayBucketWaterId;
public static int clayBucketFiredId;
public static int clayBucketUnfiredId;
public static int clayBucketsId;
*/
// leveling
public static boolean detailedXpTooltip;
public static boolean toolLeveling;
public static boolean toolLevelingExtraModifiers;
public static int[] toolModifiersAtLevels;
public static boolean toolLevelingRandomBonuses;
public static boolean showTooltipXP;
public static boolean showMinimalTooltipXP;
public static boolean showDebugXP;
public static int xpRequiredToolsPercentage;
public static int xpRequiredWeaponsPercentage;
public static double xpPerLevelMultiplier;
// pick boost
public static boolean pickaxeBoostRequired;
public static boolean mobHeadPickaxeBoost;
public static boolean levelingPickaxeBoost;
public static int levelingPickaxeBoostXpPercentage;
// repairs
public static boolean repairCostScaling;
public static boolean repairLimitActive;
public static int repairScalingModifier;
public static int repairLimit;
public static int repairCostPercentage;
// heads
public static int baseHeadDropChance;
public static int beheadingHeadDropChance;
//crafting
public static boolean easyBlankPatternRecipe;
public static boolean easyPartCrafting;
public static boolean easyPatternCrafting;
public static boolean easyToolModification;
public static boolean easyToolCreation;
//patterns
/*
public static int patternCostToolRod;
public static int patternCostPickaxeHead;
public static int patternCostShovelHead;
public static int patternCostHatchetHead;
public static int patternCostSwordBlade;
public static int patternCostWideGuard;
public static int patternCostHandGuard;
public static int patternCostCrossbar;
public static int patternCostBinding;
public static int patternCostFrypanHead;
public static int patternCostSignHead;
public static int patternCostKnifeBlade;
public static int patternCostChiselHead;
public static int patternCostToughRod;
public static int patternCostToughBinding;
public static int patternCostHeavyPlate;
public static int patternCostBroadAxeHead;
public static int patternCostScytheBlade;
public static int patternCostExcavatorHead;
public static int patternCostLargeSwordBlade;
public static int patternCostHammerHead;
public static int patternCostFullGuard;
public static int patternCostBowstring;
public static int patternCostFletching;
public static int patternCostArrowHead;
*/
// modifiers
public static boolean addCleanModifier;
public static boolean moreExpensiveSilkyCloth;
public static boolean moreExpensiveSilkyJewel;
public static int mossRepairSpeed;
public static int redstoneEffect;
//debug
public static boolean logHarvestLevelChanges;
public static boolean logMiningLevelChanges;
//other
public static boolean toolsNeverDespawn;
public static boolean partTooltips;
public static boolean partReplacement;
public static boolean cobaltArmor;
public static boolean removeStoneTorchRecipe;
public static boolean removeFlintDrop;
public static boolean addFlintRecipe;
public static int durabilityPercentage;
public static int miningSpeedPercentage;
// Harvest Levels
public static List<String> harvestLevel0Ids = new ArrayList<String>();
public static List<String> harvestLevel1Ids = new ArrayList<String>();
public static List<String> harvestLevel2Ids = new ArrayList<String>();
public static List<String> harvestLevel3Ids = new ArrayList<String>();
public static List<String> harvestLevel4Ids = new ArrayList<String>();
public static List<String> harvestLevel5Ids = new ArrayList<String>();
public static List<String> harvestLevel6Ids = new ArrayList<String>();
public static List<String> harvestLevel7Ids = new ArrayList<String>();
// Pickaxe mining level overrides
public static HashMap<Integer, Integer> pickaxeOverrides = new HashMap<Integer, Integer>();
//Restrictions
public static boolean allowStoneTools;
public static List<Integer> restrictedWoodParts = new ArrayList<Integer>();
public static List<Integer> restrictedStoneParts = new ArrayList<Integer>();
public static List<Integer> restrictedFlintParts = new ArrayList<Integer>();
public static List<Integer> restrictedBoneParts = new ArrayList<Integer>();
public static List<Integer> restrictedPaperParts = new ArrayList<Integer>();
public static List<Integer> restrictedSlimeParts = new ArrayList<Integer>();
public static List<Integer> restrictedCactusParts = new ArrayList<Integer>();
public static void init(File file)
{
Configuration config = new Configuration(file);
config.load();
// leveling
ConfigCategory levelingCategory = config.getCategory("leveling");
levelingCategory.setComment("Setup the leveling system how you like it");
Property detailedXpTooltipProperty = config.get("leveling", "detailedXpTooltip", false);
detailedXpTooltipProperty.comment = "XP tooltip shows numbers, in addition to percentage";
detailedXpTooltip = detailedXpTooltipProperty.getBoolean(false);
Property toolLevelingProperty = config.get("leveling", "toolLeveling", true);
toolLevelingProperty.comment = "Can your skill with tools 'level up' as you use them?";
toolLeveling = toolLevelingProperty.getBoolean(true);
Property toolLevelingExtraModifiersProperty = config.get("leveling", "toolLevelingExtraModifiers", true);
toolLevelingExtraModifiersProperty.comment = "Removes modifiers on new tools and gives them through leveling (requires 'toolLeveling=true')";
toolLevelingExtraModifiers = toolLevelingExtraModifiersProperty.getBoolean(true);
Property toolModifiersAtLevelsProperty = config.get("leveling", "toolModifiersAtLevels", new int[]{2,4,6});
toolModifiersAtLevelsProperty.comment = "Adds an extra modifier on these levleups if 'toolLevelingExtraModifiers' is enabled";
toolModifiersAtLevels = toolModifiersAtLevelsProperty.getIntList();
Property toolLevelingRandomBonusesProperty = config.get("leveling", "toolLevelingRandomBonuses", true);
toolLevelingRandomBonusesProperty.comment = "Gives a random bonus every level, if false and levelling is on modifiers are given at levels 2 and 4 (requires 'toolLeveling=true')";
toolLevelingRandomBonuses = toolLevelingRandomBonusesProperty.getBoolean(true);
Property showTooltipXPProperty = config.get("leveling", "showTooltipXP", true);
showTooltipXPProperty.comment = "Current XP is shown when hovering over a tool (requires 'toolLeveling=true')";
showTooltipXP = showTooltipXPProperty.getBoolean(true);
Property showMinimalTooltipXPProperty = config.get("leveling", "showMinimalTooltipXP", false);
showMinimalTooltipXPProperty.comment = "Current XP% is shown after the level (requires 'toolLeveling=true')";
showMinimalTooltipXP = showMinimalTooltipXPProperty.getBoolean(true);
Property showDebugXPProperty = config.get("leveling", "showDebugXP", false);
showDebugXPProperty.comment = "Current XP is shown as debug (F3) text (requires 'toolLeveling=true')";
showDebugXP = showDebugXPProperty.getBoolean(false);
Property xpRequiredToolsPercentageProperty = config.get("leveling", "xpRequiredToolsPercentage", 100);
xpRequiredToolsPercentageProperty.comment = "Change the XP required to level up tools (higher=more) (requires 'toolLeveling' to be true)";
xpRequiredToolsPercentage = Math.max(xpRequiredToolsPercentageProperty.getInt(100), 1);
xpRequiredToolsPercentageProperty.set(xpRequiredToolsPercentage);
Property xpRequiredWeaponsPercentageProperty = config.get("leveling", "xpRequiredWeaponsPercentage", 100);
xpRequiredWeaponsPercentageProperty.comment = "Change the XP required to level up weapons (higher=more) (requires 'toolLeveling' to be true)";
xpRequiredWeaponsPercentage = Math.max(xpRequiredWeaponsPercentageProperty.getInt(100), 1);
xpRequiredWeaponsPercentageProperty.set(xpRequiredWeaponsPercentage);
Property xpPerLevelMultiplierProperty = config.get("leveling", "xpPerLevelMultiplier", 1.35d);
xpPerLevelMultiplierProperty.comment = "Exponential multiplier on required XP per level";
xpPerLevelMultiplier = Math.max(xpPerLevelMultiplierProperty.getDouble(1.35d), 1d);
xpPerLevelMultiplierProperty.set(xpPerLevelMultiplier);
// pick leveling
ConfigCategory pickboostingCategory = config.getCategory("pickboosting");
pickboostingCategory.setComment("Options to configure to pickaxe mining level boost mechanics");
Property pickaxeBoostRequiredProperty = config.get("pickboosting", "pickaxeBoostRequired", true);
pickaxeBoostRequiredProperty.comment = "Pickaxes only mine upto their head material level and need a mob head modifier OR leveling boost to advance";
pickaxeBoostRequired = pickaxeBoostRequiredProperty.getBoolean(true);
Property mobHeadPickaxeBoostProperty = config.get("pickboosting", "mobHeadPickaxeBoost", true);
mobHeadPickaxeBoostProperty.comment = "Mob heads can be used to boost a pickaxe's mining level";
mobHeadPickaxeBoost = mobHeadPickaxeBoostProperty.getBoolean(true);
Property levelingPickaxeBoostProperty = config.get("pickboosting", "levelingPickaxeBoost", true);
levelingPickaxeBoostProperty.comment = "A pickaxes mining level can be boosted through gaining XP";
levelingPickaxeBoost = levelingPickaxeBoostProperty.getBoolean(true);
Property levelingPickaxeBoostXpPercentageProperty = config.get("pickboosting", "levelingPickaxeBoostXpPercentage", 100);
levelingPickaxeBoostXpPercentageProperty.comment = "Change the percentage of XP required to boost a pick (i.e. 200 means 2x normal boost xp required)";
levelingPickaxeBoostXpPercentage = Math.max(levelingPickaxeBoostXpPercentageProperty.getInt(100), 1);
levelingPickaxeBoostXpPercentageProperty.set(levelingPickaxeBoostXpPercentage);
// repairs
ConfigCategory repairsCategory = config.getCategory("repairs");
repairsCategory.setComment("Changes to tool repairing");
Property repairCostScalingProperty = config.get("repairs", "repairCostScaling", false);
repairCostScalingProperty.comment = "Repairs are less effective the more a tool is repaired";
repairCostScaling = repairCostScalingProperty.getBoolean(false);
Property repairLimitActiveProperty = config.get("repairs", "repairLimitActive", false);
repairLimitActiveProperty.comment = "Number of times TC tools can be repaired is limited";
repairLimitActive = repairLimitActiveProperty.getBoolean(false);
Property repairLimitProperty = config.get("repairs", "repairLimit", 25);
repairLimitProperty.comment = "Number of times TC tools can be repaired (only if 'repairLimitActive' is true) (set to 0 to disable repairs)";
repairLimit = Math.max(repairLimitProperty.getInt(25), 0);
repairLimitProperty.set(repairLimit);
Property repairScalingModifierProperty = config.get("repairs", "repairScalingModifier", 5);
repairScalingModifierProperty.comment = "Repair cost doubles after this many repairs (only if 'repairCostScaling' is true)";
repairScalingModifier = Math.max(repairScalingModifierProperty.getInt(5), 1);
repairScalingModifierProperty.set(repairScalingModifier);
Property repairCostPercentageProperty = config.get("repairs", "repairCostPercentage", 100);
repairCostPercentageProperty.comment = "Increase or decrease repair costs (higher = more expensive)";
repairCostPercentage = Math.max(repairCostPercentageProperty.getInt(100), 1);
repairCostPercentageProperty.set(repairCostPercentage);
// heads
ConfigCategory headsCategory = config.getCategory("heads");
headsCategory.setComment("Configure the mob head modifiers and drops here");
Property baseHeadDropChanceProperty = config.get("heads", "baseHeadDropChance", 5);
baseHeadDropChanceProperty.comment = "Base percentage chance for a head to drop (only if 'pickaxeHeads' is true)";
baseHeadDropChance = Math.max(baseHeadDropChanceProperty.getInt(5), 0);
baseHeadDropChanceProperty.set(baseHeadDropChance);
Property beheadingHeadDropChanceProperty = config.get("heads", "beheadingHeadDropChance", 2);
beheadingHeadDropChanceProperty.comment = "Percentage chance for a head to drop for each level of beheading (only if 'pickaxeHeads' is true)";
beheadingHeadDropChance = Math.max(beheadingHeadDropChanceProperty.getInt(2), 0);
beheadingHeadDropChanceProperty.set(beheadingHeadDropChance);
// crafting
ConfigCategory craftingCategory = config.getCategory("crafting");
craftingCategory.setComment("Allow Tinkers crafting to be done in a normal crafting window");
Property easyBlankPatternRecipeProperty = config.get("crafting", "easyBlankPatternRecipe", true);
easyBlankPatternRecipeProperty.comment = "Allows blank patterns to be crafted with 4 sticks in a square";
easyBlankPatternRecipe = easyBlankPatternRecipeProperty.getBoolean(true);
Property easyPartCraftingProperty = config.get("crafting", "easyPartCrafting", true);
easyPartCraftingProperty.comment = "Allows you to make tool parts in a normal crafting window";
easyPartCrafting = easyPartCraftingProperty.getBoolean(true);
Property easyPatternCraftingProperty = config.get("crafting", "easyPatternCrafting", true);
easyPatternCraftingProperty.comment = "Allows you to rotate the the tier 1 patterns in a normal crafting window";
easyPatternCrafting = easyPatternCraftingProperty.getBoolean(true);
Property easyToolCreationProperty = config.get("crafting", "easyToolCreation", true);
easyToolCreationProperty.comment = "Allows you create tinkers tools in a normal crafting window";
easyToolCreation = easyToolCreationProperty.getBoolean(true);
Property easyToolModificationProperty = config.get("crafting", "easyToolModification", true);
easyToolModificationProperty.comment = "Allows you add modifications to tools in a normal crafting window";
easyToolModification = easyToolModificationProperty.getBoolean(true);
// patterns
/*
ConfigCategory patternsCategory = config.getCategory("patterns");
patternsCategory.setComment("Set the material cost (in half ingots) required for each pattern type");
Property patternCostToolRodProperty = config.get("patterns", "patternCostToolRod", 1);
patternCostToolRodProperty.comment = "TCon default is 1";
patternCostToolRod = Math.max(patternCostToolRodProperty.getInt(1), 1);
patternCostToolRodProperty.set(patternCostToolRod);
Property patternCostPickaxeHeadProperty = config.get("patterns", "patternCostPickaxeHead", 6);
patternCostPickaxeHeadProperty.comment = "TCon default is 2";
patternCostPickaxeHead = Math.max(patternCostPickaxeHeadProperty.getInt(6), 1);
patternCostPickaxeHeadProperty.set(patternCostPickaxeHead);
Property patternCostShovelHeadProperty = config.get("patterns", "patternCostShovelHead", 2);
patternCostShovelHeadProperty.comment = "TCon default is 2";
patternCostShovelHead = Math.max(patternCostShovelHeadProperty.getInt(2), 1);
patternCostShovelHeadProperty.set(patternCostShovelHead);
Property patternCostHatchetHeadProperty = config.get("patterns", "patternCostHatchetHead", 4);
patternCostHatchetHeadProperty.comment = "TCon default is 2";
patternCostHatchetHead = Math.max(patternCostHatchetHeadProperty.getInt(4), 1);
patternCostHatchetHeadProperty.set(patternCostHatchetHead);
Property patternCostSwordBladeProperty = config.get("patterns", "patternCostSwordBlade", 4);
patternCostSwordBladeProperty.comment = "TCon default is 2";
patternCostSwordBlade = Math.max(patternCostSwordBladeProperty.getInt(4), 1);
patternCostSwordBladeProperty.set(patternCostSwordBlade);
Property patternCostWideGuardProperty = config.get("patterns", "patternCostWideGuard", 1);
patternCostWideGuardProperty.comment = "TCon default is 1";
patternCostWideGuard = Math.max(patternCostWideGuardProperty.getInt(1), 1);
patternCostWideGuardProperty.set(patternCostWideGuard);
Property patternCostHandGuardProperty = config.get("patterns", "patternCostHandGuard", 1);
patternCostHandGuardProperty.comment = "TCon default is 1";
patternCostHandGuard = Math.max(patternCostHandGuardProperty.getInt(1), 1);
patternCostHandGuardProperty.set(patternCostHandGuard);
Property patternCostCrossbarProperty = config.get("patterns", "patternCostCrossbar", 1);
patternCostCrossbarProperty.comment = "TCon default is 1";
patternCostCrossbar = Math.max(patternCostCrossbarProperty.getInt(1), 1);
patternCostCrossbarProperty.set(patternCostCrossbar);
Property patternCostBindingProperty = config.get("patterns", "patternCostBinding", 1);
patternCostBindingProperty.comment = "TCon default is 1";
patternCostBinding = Math.max(patternCostBindingProperty.getInt(1), 1);
patternCostBindingProperty.set(patternCostBinding);
Property patternCostFrypanHeadProperty = config.get("patterns", "patternCostFrypanHead", 6);
patternCostFrypanHeadProperty.comment = "TCon default is 2";
patternCostFrypanHead = Math.max(patternCostFrypanHeadProperty.getInt(6), 1);
patternCostFrypanHeadProperty.set(patternCostFrypanHead);
Property patternCostSignHeadProperty = config.get("patterns", "patternCostSignHead", 6);
patternCostSignHeadProperty.comment = "TCon default is 2";
patternCostSignHead = Math.max(patternCostSignHeadProperty.getInt(6), 1);
patternCostSignHeadProperty.set(patternCostSignHead);
Property patternCostKnifeBladeProperty = config.get("patterns", "patternCostKnifeBlade", 1);
patternCostKnifeBladeProperty.comment = "TCon default is 1";
patternCostKnifeBlade = Math.max(patternCostKnifeBladeProperty.getInt(1), 1);
patternCostKnifeBladeProperty.set(patternCostKnifeBlade);
Property patternCostChiselHeadProperty = config.get("patterns", "patternCostChiselHead", 1);
patternCostChiselHeadProperty.comment = "TCon default is 1";
patternCostChiselHead = Math.max(patternCostChiselHeadProperty.getInt(1), 1);
patternCostChiselHeadProperty.set(patternCostChiselHead);
Property patternCostToughRodProperty = config.get("patterns", "patternCostToughRod", 6);
patternCostToughRodProperty.comment = "TCon default is 6";
patternCostToughRod = Math.max(patternCostToughRodProperty.getInt(6), 1);
patternCostToughRodProperty.set(patternCostToughRod);
Property patternCostToughBindingProperty = config.get("patterns", "patternCostToughBinding", 6);
patternCostToughBindingProperty.comment = "TCon default is 6";
patternCostToughBinding = Math.max(patternCostToughBindingProperty.getInt(6), 1);
patternCostToughBindingProperty.set(patternCostToughBinding);
Property patternCostHeavyPlateProperty = config.get("patterns", "patternCostHeavyPlate", 16);
patternCostHeavyPlateProperty.comment = "TCon default is 16";
patternCostHeavyPlate = Math.max(patternCostHeavyPlateProperty.getInt(16), 1);
patternCostHeavyPlateProperty.set(patternCostHeavyPlate);
Property patternCostBroadAxeHeadProperty = config.get("patterns", "patternCostBroadAxeHead", 16);
patternCostBroadAxeHeadProperty.comment = "TCon default is 16";
patternCostBroadAxeHead = Math.max(patternCostBroadAxeHeadProperty.getInt(16), 1);
patternCostBroadAxeHeadProperty.set(patternCostBroadAxeHead);
Property patternCostScytheBladeProperty = config.get("patterns", "patternCostScytheBlade", 16);
patternCostScytheBladeProperty.comment = "TCon default is 16";
patternCostScytheBlade = Math.max(patternCostScytheBladeProperty.getInt(16), 1);
patternCostScytheBladeProperty.set(patternCostScytheBlade);
Property patternCostExcavatorHeadProperty = config.get("patterns", "patternCostExcavatorHead", 16);
patternCostExcavatorHeadProperty.comment = "TCon default is 16";
patternCostExcavatorHead = Math.max(patternCostExcavatorHeadProperty.getInt(16), 1);
patternCostExcavatorHeadProperty.set(patternCostExcavatorHead);
Property patternCostLargeSwordBladeProperty = config.get("patterns", "patternCostLargeSwordBlade", 16);
patternCostLargeSwordBladeProperty.comment = "TCon default is 16";
patternCostLargeSwordBlade = Math.max(patternCostLargeSwordBladeProperty.getInt(16), 1);
patternCostLargeSwordBladeProperty.set(patternCostLargeSwordBlade);
Property patternCostHammerHeadProperty = config.get("patterns", "patternCostHammerHead", 16);
patternCostHammerHeadProperty.comment = "TCon default is 16";
patternCostHammerHead = Math.max(patternCostHammerHeadProperty.getInt(16), 1);
patternCostHammerHeadProperty.set(patternCostHammerHead);
Property patternCostFullGuardProperty = config.get("patterns", "patternCostFullGuard", 6);
patternCostFullGuardProperty.comment = "TCon default is 6";
patternCostFullGuard = Math.max(patternCostFullGuardProperty.getInt(6), 1);
patternCostFullGuardProperty.set(patternCostFullGuard);
Property patternCostBowstringProperty = config.get("patterns", "patternCostBowstring", 6);
patternCostBowstringProperty.comment = "TCon default is 6";
patternCostBowstring = Math.max(patternCostBowstringProperty.getInt(6), 1);
patternCostBowstringProperty.set(patternCostBowstring);
Property patternCostFletchingProperty = config.get("patterns", "patternCostFletching", 2);
patternCostFletchingProperty.comment = "TCon default is 2";
patternCostFletching = Math.max(patternCostFletchingProperty.getInt(2), 1);
patternCostFletchingProperty.set(patternCostFletching);
Property patternCostArrowHeadProperty = config.get("patterns", "patternCostArrowHead", 2);
patternCostArrowHeadProperty.comment = "TCon default is 2";
patternCostArrowHead = Math.max(patternCostArrowHeadProperty.getInt(2), 1);
patternCostArrowHeadProperty.set(patternCostArrowHead);
*/
// modifiers
ConfigCategory modifiersCategory = config.getCategory("modifiers");
modifiersCategory.setComment("Options relating to tool modifiers");
Property addCleanModifierProperty = config.get("modifiers", "addCleanModifier", true);
addCleanModifierProperty.comment = "Silky Cloth can be used to remove all modifiers from a tool (currently safe but not working)";
addCleanModifier = addCleanModifierProperty.getBoolean(true);
Property moreExpensiveSilkyClothProperty = config.get("modifiers", "moreExpensiveSilkyCloth", true);
moreExpensiveSilkyClothProperty.comment = "Silky Cloth needs gold ingots, instead of nuggets";
moreExpensiveSilkyCloth = moreExpensiveSilkyClothProperty.getBoolean(true);
Property moreExpensiveSilkyJewelProperty = config.get("modifiers", "moreExpensiveSilkyJewel", true);
moreExpensiveSilkyJewelProperty.comment = "Silky Jewel needs emerald block, instead of one emerald";
moreExpensiveSilkyJewel = moreExpensiveSilkyJewelProperty.getBoolean(true);
Property mossRepairSpeedProperty = config.get("modifiers", "mossRepairSpeed", 3);
mossRepairSpeedProperty.comment = "Rate tools with moss repair (TC default 3)";
mossRepairSpeed = Math.max(mossRepairSpeedProperty.getInt(3), 0);
mossRepairSpeedProperty.set(mossRepairSpeed);
Property redstoneEffectProperty = config.get("modifiers", "redstoneEffect", 4);
redstoneEffectProperty.comment = "Amount each piece of redstone increases mining speed (tinkers default is 8)";
redstoneEffect = Math.max(redstoneEffectProperty.getInt(4), 1);
redstoneEffectProperty.set(redstoneEffect);
// debug
ConfigCategory debugCategory = config.getCategory("debug");
debugCategory.setComment("Debugging options");
Property logHarvestLevelChangesProperty = config.get("debug", "logHarvestLevelChanges", false);
logHarvestLevelChangesProperty.comment = "Outputs to the log when the harvest level of a block is changed";
logHarvestLevelChanges = logHarvestLevelChangesProperty.getBoolean(false);
Property logMiningLevelChangesProperty = config.get("debug", "logMiningLevelChanges", false);
logMiningLevelChangesProperty.comment = "Outputs to the log when the mining level of a tool is changed";
logMiningLevelChanges = logMiningLevelChangesProperty.getBoolean(false);
// other
ConfigCategory otherCategory = config.getCategory("other");
otherCategory.setComment("Random stuff to configure here");
Property cobaltArmorProperty = config.get("other", "cobaltArmor", false);
cobaltArmorProperty.comment = "Changes diamond armor to cobalt armor (more expensive recipe)";
cobaltArmor = cobaltArmorProperty.getBoolean(false);
Property partTooltipsProperty = config.get("other", "partTooltips", true);
partTooltipsProperty.comment = "Shows information about tool parts in the mouseover tooltip";
partTooltips = partTooltipsProperty.getBoolean(true);
Property partReplacementProperty = config.get("other", "partReplacement", true);
partReplacementProperty.comment = "Can you replace parts of existing tools?";
partReplacement = partReplacementProperty.getBoolean(true);
Property removeFlintDropProperty = config.get("other", "removeFlintDrop", true);
removeFlintDropProperty.comment = "Removes the random chance of getting flint from gravel";
removeFlintDrop = removeFlintDropProperty.getBoolean(true);
Property addFlintRecipeProperty = config.get("other", "addFlintRecipe", true);
addFlintRecipeProperty.comment = "Adds a shapeless recipe to get flint from 4 gravel blocks";
addFlintRecipe = addFlintRecipeProperty.getBoolean(true);
Property removeStoneTorchRecipeProperty = config.get("other", "removeStoneTorchRecipe", true);
removeStoneTorchRecipeProperty.comment = "Removes the recipe for Tinker's Construct's stone torch";
removeStoneTorchRecipe = removeStoneTorchRecipeProperty.getBoolean(true);
Property durabilityPercentageProperty = config.get("other", "durabilityPercentage", 50);
durabilityPercentageProperty.comment = "Change durability of all materials here (higher = tougher)";
durabilityPercentage = Math.max(durabilityPercentageProperty.getInt(50), 1);
durabilityPercentageProperty.set(durabilityPercentage);
Property miningSpeedPercentageProperty = config.get("other", "miningSpeedPercentage", 100);
miningSpeedPercentageProperty.comment = "Change mining speed of all materials here (higher = faster)";
miningSpeedPercentage = Math.max(miningSpeedPercentageProperty.getInt(100), 1);
miningSpeedPercentageProperty.set(miningSpeedPercentage);
Property toolsNeverDespawnProperty = config.get("other", "toolsNeverDespawn", true);
toolsNeverDespawnProperty.comment = "Do Tinker's tools on the ground never despawn?";
toolsNeverDespawn = toolsNeverDespawnProperty.getBoolean(true);
//restrictions
ConfigCategory restrictionsCategory = config.getCategory("restrictions");
restrictionsCategory.setComment("See config section of mod thread for list of pattern ids");
Property allowStoneToolsProperty = config.get("restrictions", "allowStoneTools", false);
allowStoneToolsProperty.comment = "Allow certain stone tools to be built (if equivalent flint tool can also be made, the stone version is allowed)";
allowStoneTools = allowStoneToolsProperty.getBoolean(false);
Property restrictedWoodPartsProperty = config.get("restrictions", "restrictedWoodParts", new int[] {2,4,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24});
restrictedWoodPartsProperty.comment = "Pattern ids to restrict for wood parts";
for (int i : restrictedWoodPartsProperty.getIntList()) restrictedWoodParts.add(i);
Property restrictedStonePartsProperty = config.get("restrictions", "restrictedStoneParts", new int[] {});
restrictedStonePartsProperty.comment = "Pattern ids to restrict for stone parts";
for (int i : restrictedStonePartsProperty.getIntList()) restrictedStoneParts.add(i);
Property restrictedFlintPartsProperty = config.get("restrictions", "restrictedFlintParts", new int[] {1,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24});
restrictedFlintPartsProperty.comment = "Pattern ids to restrict for flint parts";
for (int i : restrictedFlintPartsProperty.getIntList()) restrictedFlintParts.add(i);
Property restrictedBonePartsProperty = config.get("restrictions", "restrictedBoneParts", new int[] {2,5,6,7,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24});
restrictedBonePartsProperty.comment = "Pattern ids to restrict for bone parts";
for (int i : restrictedBonePartsProperty.getIntList()) restrictedBoneParts.add(i);
Property restrictedPaperPartsProperty = config.get("restrictions", "restrictedPaperParts", new int[] {2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25});
restrictedPaperPartsProperty.comment = "Pattern ids to restrict for paper parts";
for (int i : restrictedPaperPartsProperty.getIntList()) restrictedPaperParts.add(i);
Property restrictedSlimePartsProperty = config.get("restrictions", "restrictedSlimeParts", new int[] {2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25});
restrictedSlimePartsProperty.comment = "Pattern ids to restrict for slime parts";
for (int i : restrictedSlimePartsProperty.getIntList()) restrictedSlimeParts.add(i);
Property restrictedCactusPartsProperty = config.get("restrictions", "restrictedCactusParts", new int[] {2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25});
restrictedCactusPartsProperty.comment = "Pattern ids to restrict for cactus parts";
for (int i : restrictedCactusPartsProperty.getIntList()) restrictedCactusParts.add(i);
// harvest ids
ConfigCategory harvestidsCategory = config.getCategory("harvestids");
harvestidsCategory.setComment("Set harvest levels of blocks here (most should be modified by default, so check if needed first)");
Property harvestLevel0IdsProperty = config.get("harvestids", "harvestLevel0Ids", new String[] {});
harvestLevel0IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 0 (stone pick+)";
for (String i : harvestLevel0IdsProperty.getStringList()) harvestLevel0Ids.add(i);
Property harvestLevel1IdsProperty = config.get("harvestids", "harvestLevel1Ids", new String[] {});
harvestLevel1IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 1 (flint pick+)";
for (String i : harvestLevel1IdsProperty.getStringList()) harvestLevel1Ids.add(i);
Property harvestLevel2IdsProperty = config.get("harvestids", "harvestLevel2Ids", new String[] {});
harvestLevel2IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 2 (copper pick+)";
for (String i : harvestLevel2IdsProperty.getStringList()) harvestLevel2Ids.add(i);
Property harvestLevel3IdsProperty = config.get("harvestids", "harvestLevel3Ids", new String[] {});
harvestLevel3IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 3 (iron pick+)";
for (String i : harvestLevel3IdsProperty.getStringList()) harvestLevel3Ids.add(i);
Property harvestLevel4IdsProperty = config.get("harvestids", "harvestLevel4Ids", new String[] {});
harvestLevel4IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 4 (bronze pick+)";
for (String i : harvestLevel4IdsProperty.getStringList()) harvestLevel4Ids.add(i);
Property harvestLevel5IdsProperty = config.get("harvestids", "harvestLevel5Ids", new String[] {});
harvestLevel5IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 5 (alumite pick+)";
for (String i : harvestLevel5IdsProperty.getStringList()) harvestLevel5Ids.add(i);
Property harvestLevel6IdsProperty = config.get("harvestids", "harvestLevel6Ids", new String[] {});
harvestLevel6IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 6 (ardite pick+)";
for (String i : harvestLevel6IdsProperty.getStringList()) harvestLevel6Ids.add(i);
Property harvestLevel7IdsProperty = config.get("harvestids", "harvestLevel7Ids", new String[] {});
harvestLevel7IdsProperty.comment = "Block ids (each on seperate line) for blocks to be set to harvest level 7 (cobalt pick+)";
for (String i : harvestLevel7IdsProperty.getStringList()) harvestLevel7Ids.add(i);
// pickaxe mining level overrides
ConfigCategory pickaxeoverridesCategory = config.getCategory("pickaxeoverrides");
pickaxeoverridesCategory.setComment("Normally the mod changes the mining levels of all pickaxes to be in line with the new system, override that for specific picks here");
Property pickaxeOverridesProperty = config.get("pickaxeoverrides", "pickaxeOverrides", new String[] {});
// TODO: Find a better way to implement pickaxeOveride
/*pickaxeOverridesProperty.comment = "Format <itemID>:<miningLevel> (Each on a separate line)";
for (String i : pickaxeOverridesProperty.getStringList())
{
String[] splt = i.split(":");
pickaxeOverrides.put(Integer.parseInt(splt[0]), Integer.parseInt(splt[1]));
}*/
config.save();
}
}
@@ -1,493 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import iguanaman.iguanatweakstconstruct.reference.Config;
import net.minecraft.block.Block;
import net.minecraft.block.BlockGravel;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraftforge.event.entity.item.ItemExpireEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.crafting.PatternBuilder.ItemKey;
import tconstruct.library.crafting.PatternBuilder.MaterialSet;
import tconstruct.library.event.PartBuilderEvent;
import tconstruct.library.event.ToolCraftEvent;
import tconstruct.library.tools.ToolCore;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.smeltery.blocks.LiquidMetalFinite;
import tconstruct.tools.TinkerTools;
import java.util.Iterator;
import java.util.Random;
public class IguanaEventHandler {
Random random = new Random();
@SubscribeEvent
public void onItemExpireEvent(ItemExpireEvent event)
{
if (IguanaConfig.toolsNeverDespawn && event.entity != null && event.entity instanceof EntityItem)
{
ItemStack stack = ((EntityItem)event.entity).getEntityItem();
if (stack.getItem() != null && stack.getItem() instanceof ToolCore)
event.setResult(Event.Result.DENY);
}
}
/*
@SubscribeEvent
public void onHurt (LivingHurtEvent event)
{
if (event.source.damageType.equals("player") || event.source.damageType.equals("arrow"))
if (event.source.getEntity() instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.hasTagCompound())
if (stack.getItem() instanceof Weapon || stack.getItem() instanceof Shortbow && event.source.damageType.equals("arrow"))
{
long xp = Math.round(event.ammount);
if (event.entityLiving instanceof EntityAnimal) xp = Math.round(event.ammount / 4f);
if (xp > 0) IguanaLevelingLogic.addXP(stack, player, xp);
}
}
}
@SubscribeEvent
public void onUseHoe(UseHoeEvent event) {
EntityPlayer player = event.entityPlayer;
ItemStack stack = event.current;
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
IguanaLevelingLogic.addXP(stack, player, 1L);
}*/
void addDrops(LivingDropsEvent event, ItemStack dropStack)
{
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void LivingDrops(LivingDropsEvent event)
{
Iterator<EntityItem> i = event.drops.iterator();
while (i.hasNext()) {
EntityItem eitem = i.next();
if (eitem != null)
if (eitem.getEntityItem() != null)
{
ItemStack item = eitem.getEntityItem();
if (item.getItem() == Items.skull && item.getItemDamage() != 3)
i.remove();
}
}
if (event.recentlyHit && event.source.damageType.equals("player"))
{
int skullID = -1;
if (event.entityLiving instanceof EntitySkeleton)
skullID = ((EntitySkeleton)event.entityLiving).getSkeletonType();
else if (event.entityLiving instanceof EntityPigZombie)
skullID = 6;
else if (event.entityLiving instanceof EntityZombie)
skullID = 2;
else if (event.entityLiving instanceof EntityCreeper)
skullID = 4;
else if (event.entityLiving instanceof EntityEnderman)
skullID = 5;
else if (event.entityLiving instanceof EntityBlaze)
skullID = 7;
if (skullID != -1)
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
ItemStack stack = player.getCurrentEquippedItem();
int beheading = 0;
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
{
beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
if (stack.getItem() == TinkerTools.cleaver)
beheading += 2;
}
if (random.nextInt(100) < beheading * Config.beheadingHeadDropChance + Config.baseHeadDropChance)
addDrops(event, new ItemStack(Items.skull, 1, skullID));
}
}
}
@SubscribeEvent
public void bucketFill (FillBucketEvent evt)
{
if (evt.current.getItem() == IguanaItems.clayBucketFired && evt.target.typeOfHit == MovingObjectType.BLOCK)
{
int hitX = evt.target.blockX;
int hitY = evt.target.blockY;
int hitZ = evt.target.blockZ;
if (evt.entityPlayer != null && !evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current))
return;
Block block = evt.world.getBlock(hitX, hitY, hitZ);
for (int id = 0; id < TinkerSmeltery.fluidBlocks.length; id++)
if (block == TinkerSmeltery.fluidBlocks[id])
if (evt.entityPlayer.capabilities.isCreativeMode)
evt.world.setBlockToAir(hitX, hitY, hitZ);
else
{
if (TinkerSmeltery.fluidBlocks[id] instanceof LiquidMetalFinite)
{
int quanta = 0;
for (int posX = -1; posX <= 1; posX++)
for (int posZ = -1; posZ <= 1; posZ++)
{
Block localBlock = evt.world.getBlock(hitX + posX, hitY, hitZ + posZ);
if (localBlock == block)
quanta += evt.world.getBlockMetadata(hitX + posX, hitY, hitZ + posZ) + 1;
}
if (quanta >= 8)
while (quanta > 0)
for (int posX = -1; posX <= 1; posX++)
for (int posZ = -1; posZ <= 1; posZ++)
{
Block localBlock = evt.world.getBlock(hitX + posX, hitY, hitZ + posZ);
if (localBlock == block)
{
quanta -= 1;
int meta = evt.world.getBlockMetadata(hitX + posX, hitY, hitZ + posZ);
if (meta > 0)
evt.world.setBlockMetadataWithNotify(hitX + posX, hitY, hitZ + posZ, meta - 1, 3);
else
evt.world.setBlockToAir(hitX + posX, hitY, hitZ + posZ);
}
}
} else
evt.world.setBlockToAir(hitX, hitY, hitZ);
evt.setResult(Event.Result.ALLOW);
evt.result = new ItemStack(IguanaItems.clayBuckets, 1, id);
}
}
}
@SubscribeEvent
public void EntityInteract(EntityInteractEvent event)
{
if (event != null && event.target != null && event.target instanceof EntityCow)
{
ItemStack equipped = event.entityPlayer.getCurrentEquippedItem();
{
if (equipped != null && equipped.getItem() == IguanaItems.clayBucketFired)
if (--equipped.stackSize <= 0)
event.entityPlayer.setCurrentItemOrArmor(0, new ItemStack(IguanaItems.clayBucketMilk));
else if (!event.entityPlayer.inventory.addItemStackToInventory(new ItemStack(IguanaItems.clayBucketMilk)))
event.entityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(IguanaItems.clayBucketMilk), false);
}
}
}
@SubscribeEvent
public void craftTool (ToolCraftEvent.NormalTool event)
{
NBTTagCompound toolTag = event.toolTag.getCompoundTag("InfiTool");
int head = toolTag.getInteger("Head");
int handle = toolTag.getInteger("Handle");
int accessory = toolTag.getInteger("Accessory");
int extra = toolTag.hasKey("Extra") ? toolTag.getInteger("Extra") : -1;
if (!IguanaConfig.allowStoneTools && (head == 1 || handle == 1 || event.tool != TinkerTools.arrow && accessory == 1) || extra == 1)
{
event.setResult(Event.Result.DENY);
return;
}
else if (IguanaConfig.allowStoneTools)
{
if (head == 1)
{
int partIndex = IguanaTweaksTConstruct.toolParts.indexOf(event.tool.getHeadItem());
if (IguanaConfig.restrictedFlintParts.contains(partIndex+1))
{
event.setResult(Event.Result.DENY);
return;
}
}
if (handle == 1)
{
int partIndex = IguanaTweaksTConstruct.toolParts.indexOf(event.tool.getHandleItem());
if (IguanaConfig.restrictedFlintParts.contains(partIndex+1))
{
event.setResult(Event.Result.DENY);
return;
}
}
if (event.tool != TinkerTools.arrow && accessory == 1)
{
int partIndex = IguanaTweaksTConstruct.toolParts.indexOf(event.tool.getAccessoryItem());
if (IguanaConfig.restrictedFlintParts.contains(partIndex+1))
{
event.setResult(Event.Result.DENY);
return;
}
}
if (extra == 1)
{
int partIndex = IguanaTweaksTConstruct.toolParts.indexOf(event.tool.getExtraItem());
if (IguanaConfig.restrictedFlintParts.contains(partIndex+1))
{
event.setResult(Event.Result.DENY);
return;
}
}
}
// Leveling
/*
if (event.tool != TinkerTools.arrow)
{
// CREATE TOOLTIP LISTS
List<String> tips = new ArrayList<String>();
List<String> modifierTips = new ArrayList<String>();
// MINING LEVEL TOOLTIP
if (event.tool instanceof Pickaxe || event.tool instanceof Hammer)
{
String mLevel = IguanaTweaksTConstruct.getHarvestLevelName(toolTag.getInteger("HarvestLevel"));
tips.add("Mining Level: " + mLevel);
modifierTips.add("");
}
// TOOL LEVELING DATA + TOOLTIP
if (IguanaConfig.toolLeveling)
{
tips.add(IguanaLevelingLogic.getLevelTooltip(1));
modifierTips.add("");
toolTag.setInteger("ToolLevel", 1);
toolTag.setLong("ToolEXP", 0);
if (IguanaConfig.showTooltipXP)
{
tips.add(IguanaLevelingLogic.getXpToolTip(new ItemStack(event.tool), false, toolTag));
modifierTips.add("");
}
if (IguanaConfig.levelingPickaxeBoost && (event.tool instanceof Pickaxe || event.tool instanceof Hammer))
{
toolTag.setLong("HeadEXP", 0);
int hLevel = toolTag.hasKey("HarvestLevel") ? hLevel = toolTag.getInteger("HarvestLevel") : -1;
if (hLevel >= TConstructRegistry.getMaterial("Copper").harvestLevel() && hLevel < TConstructRegistry.getMaterial("Manyullyn").harvestLevel())
{
if (IguanaConfig.showTooltipXP)
{
tips.add(IguanaLevelingLogic.getXpToolTip(new ItemStack(event.tool), false, toolTag, true));
modifierTips.add("");
}
tips.add("\u00A76Requires boost");
modifierTips.add("");
}
}
}
// STORE + REMOVE EXISTING TOOLTIPS
int tipNum = 0;
while (true)
{
String tip = "Tooltip" + ++tipNum;
if (toolTag.hasKey(tip))
{
tips.add(toolTag.getString(tip));
modifierTips.add(toolTag.getString("ModifierTip" + tipNum));
toolTag.removeTag(tip);
toolTag.removeTag("ModifierTip" + tipNum);
}
else break;
}
// WRITE TOOLTIPS
for (int i = 1; i <= tips.size(); ++i)
if (tips.get(i - 1) != null)
{
toolTag.setString("Tooltip" + i, tips.get(i - 1));
if (modifierTips.get(i - 1) != null)
toolTag.setString("ModifierTip" + i, modifierTips.get(i - 1));
else
toolTag.setString("ModifierTip" + i, "");
}
if (IguanaConfig.toolLeveling && IguanaConfig.toolLevelingExtraModifiers)
toolTag.setInteger("Modifiers", Math.max(toolTag.getInteger("Modifiers") - 3, 0));
if (event.tool == TinkerTools.hammer || event.tool == TinkerTools.excavator || event.tool == TinkerTools.lumberaxe)
{
List<String> replaceTags = new ArrayList<String>(Arrays.asList(
"MiningSpeed", "MiningSpeed2", "MiningSpeedHandle", "MiningSpeedExtra"
));
for (String replaceTag : replaceTags)
if (toolTag.hasKey(replaceTag)) toolTag.setInteger(replaceTag, Math.round(toolTag.getInteger(replaceTag) / 2f));
}
}
*/
}
/* Crafting */
@SubscribeEvent
public void craftPart (PartBuilderEvent.NormalPart event)
{
ItemKey key = PatternBuilder.instance.getItemKey(event.material);
if (key != null)
{
MaterialSet mat = (MaterialSet) PatternBuilder.instance.materialSets.get(key.key);
if (mat != null)
if (
mat.materialID == 0 && IguanaConfig.restrictedWoodParts.contains(event.pattern.getItemDamage()) ||
mat.materialID == 1 && IguanaConfig.restrictedStoneParts.contains(event.pattern.getItemDamage()) ||
mat.materialID == 3 && IguanaConfig.restrictedFlintParts.contains(event.pattern.getItemDamage()) ||
mat.materialID == 4 && IguanaConfig.restrictedCactusParts.contains(event.pattern.getItemDamage()) ||
mat.materialID == 5 && IguanaConfig.restrictedBoneParts.contains(event.pattern.getItemDamage()) ||
mat.materialID == 8 && IguanaConfig.restrictedSlimeParts.contains(event.pattern.getItemDamage()) ||
mat.materialID == 9 && IguanaConfig.restrictedPaperParts.contains(event.pattern.getItemDamage()) ||
mat.materialID == 17 && IguanaConfig.restrictedSlimeParts.contains(event.pattern.getItemDamage())
)
{
event.setResult(Event.Result.DENY);
return;
}
}
}
@SubscribeEvent
public void onBlockHarvested(HarvestDropsEvent event)
{
if (event.block != null)
if (Config.removeFlintDrop && event.block != null && event.block instanceof BlockGravel)
{
boolean addGravel = false;
Iterator<ItemStack> it = event.drops.iterator();
while (it.hasNext())
{
ItemStack stack = (ItemStack) it.next();
if (stack != null && stack.getItem() == Items.flint)
{
it.remove();
addGravel = true;
}
}
if (addGravel) event.drops.add(new ItemStack(Blocks.gravel));
}
}
/*
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Text event) {
if (IguanaConfig.toolLeveling && IguanaConfig.showDebugXP)
{
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
if (!player.isDead && mc.gameSettings.showDebugInfo) {
ItemStack equipped = player.getCurrentEquippedItem();
if (equipped != null && equipped.getItem() != null && equipped.getItem() instanceof ToolCore)
{
NBTTagCompound tags = equipped.getTagCompound().getCompoundTag("InfiTool");
int level = tags.getInteger("ToolLevel");
int hLevel = tags.hasKey("HarvestLevel") ? hLevel = tags.getInteger("HarvestLevel") : -1;
event.left.add("");
if (IguanaConfig.showTooltipXP)
{
if (level <= 5)
event.left.add(IguanaLevelingLogic.getXpToolTip(equipped, true));
if (IguanaConfig.levelingPickaxeBoost)
if (hLevel >= TConstructRegistry.getMaterial("Copper").harvestLevel() && hLevel < TConstructRegistry.getMaterial("Manyullyn").harvestLevel()
&& !tags.hasKey("HarvestLevelModified")
&& (equipped.getItem() instanceof Pickaxe || equipped.getItem() instanceof Hammer))
event.left.add(IguanaLevelingLogic.getXpToolTip(equipped, true, true));
}
}
}
}
}*/
}
/* patterns
1 "toolRod"
2 "pickaxeHead"
3 "shovelHead"
4 "hatchetHead"
5 "swordBlade"
6 "wideGuard"
7 "handGuard",
8 "crossbar"
9 "binding"
10 "frypanHead"
11 "signHead"
12 "knifeBlade"
13 "chiselHead"
14 "toughRod"
15 "toughBinding"
16 "heavyPlate"
17 "broadAxeHead"
18 "scytheBlade"
19 "excavatorHead"
20 "largeSwordBlade"
21 "hammerHead"
12 "fullGuard"
23 "bowstring",
24 "fletching"
25 "arrowhead"
/** Default Material Index
* 0: Wood
* 1: Stone
* 2: Iron
* 3: Flint
* 4: Cactus
* 5: Bone
* 6: Obsidian
* 7: Netherrack
* 8: Green Slime
* 9: Paper
* 10: Cobalt
* 11: Ardite
* 12: Manyullyn
* 13: Copper
* 14: Bronze
* 15: Alumite
* 16: Steel
* 17: Blue Slime
*/
@@ -1,156 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import iguanaman.iguanatweakstconstruct.old.items.*;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.util.IPattern;
import tconstruct.tools.BowRecipe;
import tconstruct.tools.TinkerTools;
public class IguanaItems {
public static Item clayBucketLava;
public static Item clayBucketWater;
public static Item clayBucketMilk;
public static Item clayBucketFired;
public static Item clayBucketUnfired;
public static Item clayBuckets;
public static void init()
{
//CLAY BUCKETS
Log.info("Adding clay buckets");
clayBucketUnfired = new Item().setUnlocalizedName("iguanatweakstconstruct:clayBucketUnfired").setTextureName("iguanatweakstconstruct:clayBucketUnfired").setMaxStackSize(16).setCreativeTab(CreativeTabs.tabMisc);
clayBucketFired = new ClayBucket(Blocks.air).setUnlocalizedName("iguanatweakstconstruct:clayBucketFired").setTextureName("iguanatweakstconstruct:clayBucketFired").setMaxStackSize(16);
clayBucketWater = new ClayBucket(Blocks.flowing_water).setUnlocalizedName("iguanatweakstconstruct:clayBucketWater").setTextureName("iguanatweakstconstruct:clayBucketWater").setContainerItem(clayBucketFired);
clayBucketLava = new ClayBucket(Blocks.flowing_lava).setUnlocalizedName("iguanatweakstconstruct:clayBucketLava").setTextureName("iguanatweakstconstruct:clayBucketLava");
clayBucketMilk = new ClayBucketMilk().setUnlocalizedName("iguanatweakstconstruct:clayBucketMilk").setTextureName("iguanatweakstconstruct:clayBucketMilk").setContainerItem(clayBucketFired);
clayBuckets = new ClayBucketFilled(Blocks.air);
LanguageRegistry.addName(clayBucketUnfired, "Unfired Clay Bucket");
LanguageRegistry.addName(clayBucketFired, "Clay Bucket");
LanguageRegistry.addName(clayBucketWater, "Clay Bucket (Water)");
LanguageRegistry.addName(clayBucketLava, "Clay Bucket (Lava)");
LanguageRegistry.addName(clayBucketMilk, "Clay Bucket (Milk)");
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(clayBucketUnfired), "c c", " c ", 'c', new ItemStack(Items.clay_ball)));
GameRegistry.addSmelting(clayBucketUnfired, new ItemStack(clayBucketFired), 0.0F);
OreDictionary.registerOre("listAllmilk", clayBucketMilk);
ItemStack emptyClayBucket = new ItemStack(clayBucketFired);
FluidContainerRegistry.registerFluidContainer(FluidRegistry.WATER, new ItemStack(clayBucketWater), emptyClayBucket);
FluidContainerRegistry.registerFluidContainer(FluidRegistry.LAVA, new ItemStack(clayBucketLava), emptyClayBucket);
//TCON PARTS
TinkerTools.toolRod = new IguanaToolPart("_rod", "ToolRod").setUnlocalizedName("tconstruct.ToolRod");
TinkerTools.pickaxeHead = new IguanaToolPart("_pickaxe_head", "PickHead").setUnlocalizedName("tconstruct.PickaxeHead");
TinkerTools.shovelHead = new IguanaToolPart("_shovel_head", "ShovelHead").setUnlocalizedName("tconstruct.ShovelHead");
TinkerTools.hatchetHead = new IguanaToolPart("_axe_head", "AxeHead").setUnlocalizedName("tconstruct.AxeHead");
TinkerTools.binding = new IguanaToolPart("_binding", "Binding").setUnlocalizedName("tconstruct.Binding");
TinkerTools.toughBinding = new IguanaToolPart("_toughbind", "ToughBind").setUnlocalizedName("tconstruct.ThickBinding");
TinkerTools.toughRod = new IguanaToolPart("_toughrod", "ToughRod").setUnlocalizedName("tconstruct.ThickRod");
TinkerTools.largePlate = new IguanaToolPart("_largeplate", "LargePlate").setUnlocalizedName("tconstruct.LargePlate");
TinkerTools.swordBlade = new IguanaToolPart("_sword_blade", "SwordBlade").setUnlocalizedName("tconstruct.SwordBlade");
TinkerTools.wideGuard = new IguanaToolPart("_large_guard", "LargeGuard").setUnlocalizedName("tconstruct.LargeGuard");
TinkerTools.handGuard = new IguanaToolPart("_medium_guard", "MediumGuard").setUnlocalizedName("tconstruct.MediumGuard");
TinkerTools.crossbar = new IguanaToolPart("_crossbar", "Crossbar").setUnlocalizedName("tconstruct.Crossbar");
TinkerTools.knifeBlade = new IguanaToolPart("_knife_blade", "KnifeBlade").setUnlocalizedName("tconstruct.KnifeBlade");
TinkerTools.fullGuard = new IguanaToolPart("_full_guard", "FullGuard").setUnlocalizedName("tconstruct.FullGuard");
TinkerTools.frypanHead = new IguanaToolPart("_frypan_head", "FrypanHead").setUnlocalizedName("tconstruct.FrypanHead");
TinkerTools.signHead = new IguanaToolPart("_battlesign_head", "SignHead").setUnlocalizedName("tconstruct.SignHead");
TinkerTools.chiselHead = new IguanaToolPart("_chisel_head", "ChiselHead").setUnlocalizedName("tconstruct.ChiselHead");
TinkerTools.scytheBlade = new IguanaToolPart("_scythe_head", "ScytheHead").setUnlocalizedName("tconstruct.ScytheBlade");
TinkerTools.broadAxeHead = new IguanaToolPart("_lumberaxe_head", "LumberHead").setUnlocalizedName("tconstruct.LumberHead");
TinkerTools.excavatorHead = new IguanaToolPart("_excavator_head", "ExcavatorHead").setUnlocalizedName("tconstruct.ExcavatorHead");
TinkerTools.largeSwordBlade = new IguanaToolPart("_large_sword_blade", "LargeSwordBlade").setUnlocalizedName("tconstruct.LargeSwordBlade");
TinkerTools.hammerHead = new IguanaToolPart("_hammer_head", "HammerHead").setUnlocalizedName("tconstruct.HammerHead");
TinkerTools.arrowhead = new IguanaToolPart("_arrowhead", "ArrowHead").setUnlocalizedName("tconstruct.Arrowhead");
// RE-ADD TOOL RECIPES
ToolBuilder tb = ToolBuilder.instance;
ToolBuilder.addNormalToolRecipe(TinkerTools.pickaxe, TinkerTools.pickaxeHead, TinkerTools.toolRod, TinkerTools.binding);
ToolBuilder.addNormalToolRecipe(TinkerTools.broadsword, TinkerTools.swordBlade, TinkerTools.toolRod, TinkerTools.wideGuard);
ToolBuilder.addNormalToolRecipe(TinkerTools.hatchet, TinkerTools.hatchetHead, TinkerTools.toolRod);
ToolBuilder.addNormalToolRecipe(TinkerTools.shovel, TinkerTools.shovelHead, TinkerTools.toolRod);
ToolBuilder.addNormalToolRecipe(TinkerTools.longsword, TinkerTools.swordBlade, TinkerTools.toolRod, TinkerTools.handGuard);
ToolBuilder.addNormalToolRecipe(TinkerTools.rapier, TinkerTools.swordBlade, TinkerTools.toolRod, TinkerTools.crossbar);
ToolBuilder.addNormalToolRecipe(TinkerTools.frypan, TinkerTools.frypanHead, TinkerTools.toolRod);
ToolBuilder.addNormalToolRecipe(TinkerTools.battlesign, TinkerTools.signHead, TinkerTools.toolRod);
ToolBuilder.addNormalToolRecipe(TinkerTools.mattock, TinkerTools.hatchetHead, TinkerTools.toolRod, TinkerTools.shovelHead);
ToolBuilder.addNormalToolRecipe(TinkerTools.dagger, TinkerTools.knifeBlade, TinkerTools.toolRod, TinkerTools.crossbar);
ToolBuilder.addNormalToolRecipe(TinkerTools.cutlass, TinkerTools.swordBlade, TinkerTools.toolRod, TinkerTools.fullGuard);
ToolBuilder.addNormalToolRecipe(TinkerTools.chisel, TinkerTools.chiselHead, TinkerTools.toolRod);
ToolBuilder.addNormalToolRecipe(TinkerTools.scythe, TinkerTools.scytheBlade, TinkerTools.toughRod, TinkerTools.toughBinding, TinkerTools.toughRod);
ToolBuilder.addNormalToolRecipe(TinkerTools.lumberaxe, TinkerTools.broadAxeHead, TinkerTools.toughRod, TinkerTools.largePlate, TinkerTools.toughBinding);
ToolBuilder.addNormalToolRecipe(TinkerTools.cleaver, TinkerTools.largeSwordBlade, TinkerTools.toughRod, TinkerTools.largePlate, TinkerTools.toughRod);
ToolBuilder.addNormalToolRecipe(TinkerTools.excavator, TinkerTools.excavatorHead, TinkerTools.toughRod, TinkerTools.largePlate, TinkerTools.toughBinding);
ToolBuilder.addNormalToolRecipe(TinkerTools.hammer, TinkerTools.hammerHead, TinkerTools.toughRod, TinkerTools.largePlate, TinkerTools.largePlate);
ToolBuilder.addNormalToolRecipe(TinkerTools.battleaxe, TinkerTools.broadAxeHead, TinkerTools.toughRod, TinkerTools.broadAxeHead, TinkerTools.toughBinding);
ToolBuilder.addNormalToolRecipe(TinkerTools.arrow, TinkerTools.arrowhead, TinkerTools.toolRod, TinkerTools.fletching);
ToolBuilder.addCustomToolRecipe(new BowRecipe(TinkerTools.toolRod, TinkerTools.bowstring, TinkerTools.toolRod, TinkerTools.shortbow));
//SKULL ITEM
Log.info("Adding skullItem prefix");
// TODO: find a way to replace vanilla skullItem
/*Item.itemsList[Item.skullItem.itemID] = null;
Item.skullItem = new IguanaItemSkull(141).setUnlocalizedName("skullItem").setTextureName("skullItem");
LanguageRegistry.addName(new ItemStack(Item.skullItem, 1, 5), "Enderman Head");
LanguageRegistry.addName(new ItemStack(Item.skullItem, 1, 6), "Zombie Pigman Head");
LanguageRegistry.addName(new ItemStack(Item.skullItem, 1, 7), "Blaze Head");*/
//COBALT ARMOR
if (IguanaConfig.cobaltArmor)
{
Log.info("Changing diamond armor to cobalt armor");
// TODO: Implement Cobalt Armor
/*LanguageRegistry.addName(new ItemStack(Item.helmetDiamond), "Cobalt Helmet");
LanguageRegistry.addName(new ItemStack(Item.plateDiamond), "Cobalt Chestplate");
LanguageRegistry.addName(new ItemStack(Item.bootsDiamond), "Cobalt Boots");
LanguageRegistry.addName(new ItemStack(Item.legsDiamond), "Cobalt Leggings");
RecipeRemover.removeAnyRecipe(new ItemStack(Item.helmetDiamond));
RecipeRemover.removeAnyRecipe(new ItemStack(Item.plateDiamond));
RecipeRemover.removeAnyRecipe(new ItemStack(Item.bootsDiamond));
RecipeRemover.removeAnyRecipe(new ItemStack(Item.legsDiamond));
String[][] recipePatterns = new String[][] {{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}};
Object[] recipeItems = new Object[] {Item.helmetDiamond, Item.plateDiamond, Item.legsDiamond, Item.bootsDiamond};
for (int j = 0; j < recipeItems.length; ++j)
{
Item prefix = (Item)recipeItems[j];
CraftingManager.getInstance().addRecipe(new ItemStack(prefix), new Object[] {recipePatterns[j], 'X', new ItemStack(TContent.materials, 1, 3)});
}*/
}
// NEW TCON PATTERNS
TinkerTools.woodPattern = null;
//Item.itemsList[TContent.metalPattern.itemID] = null;
TinkerTools.woodPattern = new IguanaPattern("pattern_", "materials/").setUnlocalizedName("tconstruct.Pattern");
//TContent.metalPattern = new IguanaMetalPattern(PHConstruct.metalPattern, "cast_", "materials/").setUnlocalizedName("tconstruct.MetalPattern");
PatternBuilder.instance.addToolPattern((IPattern) TinkerTools.woodPattern);
}
}
@@ -1,71 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.tools.TinkerTools;
public class IguanaPartBuildRecipe implements IRecipe {
ItemStack placeholder = new ItemStack(Blocks.stone);
ItemStack output = null;
@Override
public boolean matches(InventoryCrafting inv, World world) {
// setup
output = null;
ItemStack material = null;
ItemStack pattern = null;
// check inputs
for (int x = 0; x < inv.getSizeInventory(); x++)
{
ItemStack slot = inv.getStackInSlot(x);
// Item in slot
if (slot != null)
{
// is the prefix in the slot a wood pattern?
boolean isPattern = false;
if (slot.getItem()== TinkerTools.woodPattern) isPattern = true;
// too many items
if (material != null && pattern != null || material != null && !isPattern) return false;
// found a new prefix
if (isPattern) pattern = slot;
else material = slot;
}
}
// try to build a part
ItemStack[] outputs = PatternBuilder.instance.getToolPart(material, pattern, null);
// part crafting failed
if (outputs == null) return false;
// part crafting succeeded
output = outputs[0];
return true;
}
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
if (output != null) return output;
else return placeholder;
}
@Override
public int getRecipeSize() { return 3; }
@Override
public ItemStack getRecipeOutput() {
if (output != null) return output.copy();
else return placeholder.copy();
}
}
@@ -1,76 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
//import tconstruct.common.TContent;
//import cpw.mods.fml.common.ICraftingHandler;
//TODO: Find the crating Handler replacement
public class IguanaPartCraftingHandler /*implements ICraftingHandler*/ {
/*@Override
public void onCrafting(EntityPlayer player, ItemStack prefix, IInventory craftMatrix) {
ItemStack pattern = null;
ItemStack material = null;
for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
{
ItemStack slot = craftMatrix.getStackInSlot(i);
// Item in slot
if (slot != null)
{
// is the prefix in the slot a wood pattern?
boolean isPattern = false;
if (slot.getItem() == TinkerTools.woodPattern) isPattern = true;
// too many items
if (material != null && pattern != null || material != null && !isPattern) return;
// found a new prefix
if (isPattern) pattern = slot;
else material = slot;
}
}
if (pattern == null || material == null) return;
// part crafting occurred
int cost = ((Pattern)TinkerTools.woodPattern).getPatternCost(pattern);
ItemKey key = PatternBuilder.instance.getItemKey(material);
int value = -1;
if (key == null)
{
// check if trying to craft a bow string
CustomMaterial mat = TConstructRegistry.getCustomMaterial(material, BowstringMaterial.class);
if (mat == null)
{
// check if trying to craft a fletching
mat = TConstructRegistry.getCustomMaterial(material, FletchingMaterial.class);
//not sure why this would ever happen, but just in case
if (mat == null) return;
}
value = mat.value;
} else
value = key.value;
int used = Math.max(Math.round((float)cost / (float)value), 1) - 1;
/*
IguanaLog.log("cost " + cost);
IguanaLog.log("value " + value);
IguanaLog.log("used " + used);
*/
/*if (used > 0)
if (material.stackSize < used) material = null;
else material.stackSize -= used;
}
@Override
public void onSmelting(EntityPlayer player, ItemStack prefix) {
}*/
}
@@ -1,26 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
//import tconstruct.common.TContent;
//import cpw.mods.fml.common.ICraftingHandler;
// TODO: Find the crating Handler replacement
public class IguanaPatternCraftingHandler /*implements ICraftingHandler*/ {
/*@Override
public void onCrafting(EntityPlayer player, ItemStack prefix, IInventory craftMatrix) {
if (prefix.getItem().itemID == TContent.woodPattern.itemID)
for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
{
ItemStack inSlot = craftMatrix.getStackInSlot(i);
if (inSlot != null && inSlot.getItem().itemID == TContent.woodPattern.itemID)
if (inSlot.stackSize > 1) --inSlot.stackSize;
else craftMatrix.setInventorySlotContents(i, null);
}
}
@Override
public void onSmelting(EntityPlayer player, ItemStack prefix) {}*/
}
@@ -1,112 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
import tconstruct.library.crafting.ModifyBuilder;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.tools.ToolCore;
import java.util.ArrayList;
public class IguanaToolBuildRecipe implements IRecipe {
ItemStack placeholder = new ItemStack(Blocks.stone);
ItemStack output = null;
@Override
public boolean matches(InventoryCrafting inv, World world) {
output = null;
boolean toolFound = false;
ArrayList<ItemStack> inputs = new ArrayList<ItemStack>();
for (int x = 0; x < inv.getSizeInventory(); x++)
{
ItemStack slot = inv.getStackInSlot(x);
// Item in slot
if (slot != null)
{
//Too many items
if (!IguanaConfig.easyToolCreation && inputs.size() == 3 || inputs.size() == 4) return false;
// if a tool is found, make sure easy modifications are allowed first
if (!IguanaConfig.easyToolModification && slot.getItem() instanceof ToolCore) return false;
if (slot.getItem() instanceof ToolCore) toolFound = true;
inputs.add(slot);
}
}
// less than two items is useless
if (inputs.size() < 2) return false;
// Only modification allowed and no tool found
if (!IguanaConfig.easyToolCreation && !toolFound) return false;
// Make sure size is 4 "itemstacks"
while (inputs.size() < 4) inputs.add(null);
// loop things
for (int i1 = 0; i1 < 4; ++i1)
{
ItemStack input1 = inputs.get(i1);
if (input1 == null || !IguanaConfig.easyToolCreation && !(input1.getItem() instanceof ToolCore)) continue;
for (int i2 = 0; i2 < 4; ++i2)
{
ItemStack input2 = inputs.get(i2);
if (input2 == null) continue;
for (int i3 = 0; i3 < 4; ++i3)
{
ItemStack input3 = inputs.get(i3);
for (int i4 = 0; i4 < 4; ++i4)
{
ItemStack input4 = inputs.get(i4);
// make sure each part is unique
if (i1 == i2 || i1 == i3 || i1 == i4) continue;
if (i2 == i3 || i2 == i4) continue;
if (i3 == i4) continue;
// try to build / modify something
if (IguanaConfig.easyToolCreation && !toolFound)
output = ToolBuilder.instance.buildTool(input1, input2, input3, input4, "");
else if (input1.getItem() instanceof ToolCore && input1.hasTagCompound() && input1.getTagCompound().getCompoundTag("InfiTool") != null)
output = ModifyBuilder.instance.modifyItem(input1, new ItemStack[] {input2, input3, input4});
// If modification was successful
if (output != null) return true;
// Only tool modification allowed so input4 will always be null
if (!IguanaConfig.easyToolCreation) break;
}
}
}
}
// Otherwise no
return false;
}
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
if (output != null) return output;
else return placeholder;
}
@Override
public int getRecipeSize() { return 3; }
@Override
public ItemStack getRecipeOutput() {
if (output != null) return output.copy();
else return placeholder.copy();
}
}
@@ -1,123 +0,0 @@
package iguanaman.iguanatweakstconstruct.old;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import iguanaman.iguanatweakstconstruct.debug.DebugCommand;
import iguanaman.iguanatweakstconstruct.leveling.IguanaToolLeveling;
import iguanaman.iguanatweakstconstruct.leveling.commands.IguanaCommandLevelUpTool;
import iguanaman.iguanatweakstconstruct.leveling.commands.IguanaCommandToolXP;
import iguanaman.iguanatweakstconstruct.proxy.CommonProxy;
import iguanaman.iguanatweakstconstruct.reference.Config;
import iguanaman.iguanatweakstconstruct.reference.Reference;
import iguanaman.iguanatweakstconstruct.util.Log;
import mantle.pulsar.config.ForgeCFG;
import mantle.pulsar.control.PulseManager;
import mantle.pulsar.pulse.PulseMeta;
import net.minecraft.item.Item;
import tconstruct.tools.TinkerTools;
import java.util.Arrays;
import java.util.List;
//@Mod(modid= IguanaReference.MOD_ID, name=IguanaReference.MOD_NAME, version="1.6.X-1p",
//dependencies = "required-after:" + IguanaReference.TCON_MOD_ID + ";after:*")
public class IguanaTweaksTConstructOld {
// The instance of your mod that Forge uses.
//@Instance(Reference.MOD_ID)
public static IguanaTweaksTConstructOld instance;
// Says where the client and server 'proxy' code is loaded.
//@SidedProxy(clientSide= Reference.PROXY_CLIENT_CLASS, serverSide= Reference.PROXY_SERVER_CLASS)
public static CommonProxy proxy;
public static List<Item> toolParts = null;
// TODO: decide wether or not the same cfg as tcon should be used
// use the PulseManager. This allows us to separate the different parts into independend modules and have stuff together. yay.
private ForgeCFG pulseCFG = new ForgeCFG("TinkersModules", "Addon: Iguana Tweaks for Tinkers Construct");
private PulseManager pulsar = new PulseManager(Reference.MOD_ID, pulseCFG);
// @EventHandler
public void preInit(FMLPreInitializationEvent event) {
//proxy.registerSounds();
//NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
IguanaConfig.init(event.getSuggestedConfigurationFile());
toolParts = Arrays.asList (
TinkerTools.toolRod, TinkerTools.pickaxeHead, TinkerTools.shovelHead, TinkerTools.hatchetHead,
TinkerTools.binding, TinkerTools.toughBinding, TinkerTools.toughRod, TinkerTools.largePlate,
TinkerTools.swordBlade, TinkerTools.wideGuard, TinkerTools.handGuard, TinkerTools.crossbar,
TinkerTools.knifeBlade, TinkerTools.fullGuard, TinkerTools.frypanHead, TinkerTools.signHead,
TinkerTools.chiselHead, TinkerTools.scytheBlade, TinkerTools.broadAxeHead, TinkerTools.excavatorHead,
TinkerTools.largeSwordBlade, TinkerTools.hammerHead, TinkerTools.bowstring, TinkerTools.fletching,
TinkerTools.arrowhead );
//IguanaBlocks.init();
//IguanaItems.init();
pulsar.registerPulse(new IguanaToolLeveling());
pulsar.preInit(event);
}
// @EventHandler
public void load(FMLInitializationEvent event) {
pulsar.init(event);
}
// @EventHandler
public void postInit(FMLPostInitializationEvent event) {
//proxy.registerRenderers();
//MaterialTweaks.init();
//ModifierTweaks.init();
//VariousTweaks.init();
//RemoveVanillaTools.init();
// TODO: need to re-implement harvest level tweaks
//HarvestLevelTweaks.init();
Log.info("Starting event handlers");
//MinecraftForge.EVENT_BUS.register(new IguanaEventHandler());
pulsar.postInit(event);
}
// @EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
// TODO: change this to a proper isModuleLoaded or something in Pulsar 0.4+ (when released/implemented)
PulseMeta meta = new PulseMeta(Reference.PULSE_LEVELING, "", false, false);
if (pulseCFG.isModuleEnabled(meta))
{
Log.debug("Adding command: leveluptool");
event.registerServerCommand(new IguanaCommandLevelUpTool());
Log.debug("Adding command: toolxp");
event.registerServerCommand(new IguanaCommandToolXP());
event.registerServerCommand(new DebugCommand());
}
}
public static String getHarvestLevelName (int num)
{
if (Config.pickaxeBoostRequired && num > 1) --num;
switch (num)
{
case 0: return "\u00a77Stone";
case 1: return "\u00a76Copper";
case 2: return "\u00a74Iron";
case 3: return "\u00a7fTin";
case 4: return "\u00a7bDiamond";
case 5: return "\u00a7cArdite";
case 6: return "\u00a79Cobalt";
case 7: return "\u00a75Manyullyn";
default: return "\u00a7k\u00a7k\u00a7k\u00a7k\u00a7k\u00a7k";
}
}
}
@@ -1,22 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.blocks;
import net.minecraft.block.BlockSkull;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class IguanaBlockSkull extends BlockSkull {
public IguanaBlockSkull() {
super();
}
/**
* Returns a new instance of a prefix's tile entity class. Called on placing the prefix.
*/
@Override
public TileEntity createNewTileEntity(World world, int metadata)
{
return new IguanaTileEntitySkull();
}
}
@@ -1,55 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.blocks;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.world.World;
import tconstruct.world.blocks.GravelOre;
import java.util.Random;
public class IguanaGravelOre extends GravelOre {
public IguanaGravelOre() {
super();
}
/**
* Ticks the prefix if it's been scheduled
*/
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote)
// func_149831_e = canFallBelow
if (func_149831_e(par1World, par2, par3 - 1, par4) && par3 >= 0)
{
byte b0 = 32;
if (!fallInstantly && par1World.checkChunksExist(par2 - b0, par3 - b0, par4 - b0, par2 + b0, par3 + b0, par4 + b0))
{
if (!par1World.isRemote)
{
EntityFallingBlock entityfallingblock = new EntityFallingBlock(par1World, par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, this, par1World.getBlockMetadata(par2, par3, par4));
// field_145813_c = shouldDropItem
entityfallingblock.field_145813_c = false;
// func_149829_a = onStartFalling
func_149829_a(entityfallingblock);
par1World.spawnEntityInWorld(entityfallingblock);
}
}
else
{
par1World.setBlockToAir(par2, par3, par4);
// func_149831_e = canFallBelow
while (func_149831_e(par1World, par2, par3 - 1, par4) && par3 > 0)
--par3;
if (par3 > 0)
par1World.setBlock(par2, par3, par4, this);
}
}
}
}
@@ -1,9 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.blocks;
import net.minecraft.tileentity.TileEntitySkull;
public class IguanaTileEntitySkull extends TileEntitySkull {
public IguanaTileEntitySkull() {}
}
@@ -1,20 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.blocks;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import net.minecraft.block.material.Material;
import tconstruct.tools.blocks.ToolForgeBlock;
public class IguanaToolForgeBlock extends ToolForgeBlock {
public IguanaToolForgeBlock(Material material) {
super(material);
}
@Override
public Object getModInstance ()
{
return IguanaTweaksTConstruct.instance;
}
}
@@ -1,19 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.blocks;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import net.minecraft.block.material.Material;
import tconstruct.tools.blocks.ToolStationBlock;
public class IguanaToolStationBlock extends ToolStationBlock {
public IguanaToolStationBlock(Material material) {
super(material);
}
@Override
public Object getModInstance ()
{
return IguanaTweaksTConstruct.instance;
}
}
@@ -1,258 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.gui;
import iguanaman.iguanatweakstconstruct.util.HarvestLevels;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import tconstruct.client.gui.NewContainerGui;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.tools.ToolMaterial;
import tconstruct.smeltery.inventory.ActiveContainer;
import tconstruct.tools.inventory.PartCrafterChestContainer;
import tconstruct.tools.logic.PartBuilderLogic;
public class IguanaPartCrafterGui extends NewContainerGui
{
PartBuilderLogic logic;
String title, otherTitle = "";
boolean drawChestPart;
boolean hasTop, hasBottom;
ItemStack topMaterial, bottomMaterial;
ToolMaterial topEnum, bottomEnum;
public IguanaPartCrafterGui(InventoryPlayer inventoryplayer, PartBuilderLogic partlogic, World world, int x, int y, int z)
{
super((ActiveContainer) partlogic.getGuiContainer(inventoryplayer, world, x, y, z));
logic = partlogic;
drawChestPart = container instanceof PartCrafterChestContainer;
title = "\u00A7nTool Part Crafting";
}
@Override
protected void drawGuiContainerForegroundLayer (int par1, int par2)
{
fontRendererObj.drawString(StatCollector.translateToLocal("crafters.PartBuilder"), 6, 6, 4210752);
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
if (drawChestPart)
fontRendererObj.drawString(StatCollector.translateToLocal("inventory.PatternChest"), -108, ySize - 148, 4210752);
drawMaterialInformation();
}
void drawDefaultInformation ()
{
title = "\u00A7nTool Part Building";
drawCenteredString(fontRendererObj, title, xSize + 63, 8, 16777215);
fontRendererObj.drawSplitString("Place a pattern and a material on the left to get started.", xSize + 8, 24, 115, 16777215);
}
void drawMaterialInformation ()
{
ItemStack top = logic.getStackInSlot(2);
//ItemStack topResult = logic.getStackInSlot(4);
ItemStack bottom = logic.getStackInSlot(3);
//ItemStack bottomResult = logic.getStackInSlot(6);
if (topMaterial != top)
{
topMaterial = top;
int topID = PatternBuilder.instance.getPartID(top);
if (topID != Short.MAX_VALUE)// && topResult != null)
{
topEnum = TConstructRegistry.getMaterial(topID);
hasTop = true;
title = "\u00A7n" + topEnum.name();
}
else
hasTop = false;
}
if (bottomMaterial != bottom)
{
bottomMaterial = bottom;
int bottomID = PatternBuilder.instance.getPartID(bottom);
if (bottomID != Short.MAX_VALUE)// && bottomResult != null)
{
bottomEnum = TConstructRegistry.getMaterial(bottomID);
hasBottom = true;
otherTitle = "\u00A7n" + bottomEnum.name();
}
else
hasBottom = false;
}
int offset = 8;
if (hasTop)
{
drawCenteredString(fontRendererObj, title, xSize + 63, offset, 16777215);
fontRendererObj.drawString("Base Durability: " + topEnum.durability(), xSize + 8, offset + 16, 16777215);
fontRendererObj.drawString("Handle Modifier: " + topEnum.handleDurability() + "x", xSize + 8, offset + 27, 16777215);
fontRendererObj.drawString("Mining Speed: " + topEnum.toolSpeed() / 100f, xSize + 8, offset + 38, 16777215);
fontRendererObj.drawString("Mining Level: " + getHarvestLevelName(topEnum.harvestLevel()), xSize + 8, offset + 49, 16777215);
int attack = topEnum.attack();
String heart = attack == 2 ? " Heart" : " Hearts";
if (attack % 2 == 0)
fontRendererObj.drawString("Attack: " + attack / 2 + heart, xSize + 8, offset + 60, 0xffffff);
else
fontRendererObj.drawString("Attack: " + attack / 2f + heart, xSize + 8, offset + 60, 0xffffff);
}
offset = 90;
if (hasBottom)
{
drawCenteredString(fontRendererObj, otherTitle, xSize + 63, offset, 16777215);
fontRendererObj.drawString("Base Durability: " + bottomEnum.durability(), xSize + 8, offset + 16, 16777215);
fontRendererObj.drawString("Handle Modifier: " + bottomEnum.handleDurability() + "x", xSize + 8, offset + 27, 16777215);
fontRendererObj.drawString("Mining Speed: " + bottomEnum.toolSpeed() / 100f, xSize + 8, offset + 38, 16777215);
fontRendererObj.drawString("Mining Level: " + getHarvestLevelName(bottomEnum.harvestLevel()), xSize + 8, offset + 49, 16777215);
int attack = bottomEnum.attack();
String heart = attack == 2 ? " Heart" : " Hearts";
if (attack % 2 == 0)
fontRendererObj.drawString("Attack: " + attack / 2 + heart, xSize + 8, offset + 60, 0xffffff);
else
fontRendererObj.drawString("Attack: " + attack / 2f + heart, xSize + 8, offset + 60, 0xffffff);
}
if (!hasTop && !hasBottom)
drawDefaultInformation();
}
public static String getHarvestLevelName (int num)
{
return HarvestLevels.getHarvestLevelName(num);
}
private static final ResourceLocation background = new ResourceLocation("tinker", "textures/gui/toolparts.png");
private static final ResourceLocation minichest = new ResourceLocation("tinker", "textures/gui/patternchestmini.png");
private static final ResourceLocation description = new ResourceLocation("tinker", "textures/gui/description.png");
@Override
protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
{
// Draw the background
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(background);
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
// Draw Slots
drawTexturedModalRect(cornerX + 39, cornerY + 26, 0, 166, 98, 36);
if (!logic.isStackInSlot(0))
drawTexturedModalRect(cornerX + 39, cornerY + 26, 176, 0, 18, 18);
if (!logic.isStackInSlot(2))
drawTexturedModalRect(cornerX + 57, cornerY + 26, 176, 18, 18, 18);
if (!logic.isStackInSlot(1))
drawTexturedModalRect(cornerX + 39, cornerY + 44, 176, 0, 18, 18);
if (!logic.isStackInSlot(3))
drawTexturedModalRect(cornerX + 57, cornerY + 44, 176, 36, 18, 18);
// Draw chest
if (drawChestPart)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(minichest);
drawTexturedModalRect(cornerX - 116, cornerY + 11, 0, 0, xSize, ySize);
}
// Draw description
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(description);
cornerX = (width + xSize) / 2;
cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 126, 0, 126, ySize);
}
@Override
protected void mouseClicked (int mouseX, int mouseY, int clickNum)
{
boolean flag = clickNum == mc.gameSettings.keyBindPickBlock.getKeyCode() + 100;
Slot slot = getSlotAtPosition(mouseX, mouseY);
long l = Minecraft.getSystemTime();
field_94074_J = field_94072_H == slot && l - field_94070_G < 250L && field_94073_I == clickNum;
field_94068_E = false;
int offsetLeft = drawChestPart ? 108 : 0;
if (clickNum == 0 || clickNum == 1 || flag)
{
int i1 = guiLeft;
int j1 = guiTop;
boolean flag1 = mouseX < i1 - offsetLeft || mouseY < j1 || mouseX >= i1 + xSize || mouseY >= j1 + ySize;
int k1 = -1;
if (slot != null)
k1 = slot.slotNumber;
if (flag1)
k1 = -999;
if (mc.gameSettings.touchscreen && flag1 && mc.thePlayer.inventory.getItemStack() == null)
{
mc.displayGuiScreen((GuiScreen) null);
return;
}
if (k1 != -1)
if (mc.gameSettings.touchscreen)
{
if (slot != null && slot.getHasStack())
{
clickedSlot = slot;
draggedStack = null;
isRightMouseClick = clickNum == 1;
} else
clickedSlot = null;
}
else if (!field_94076_q)
if (mc.thePlayer.inventory.getItemStack() == null)
{
if (clickNum == mc.gameSettings.keyBindPickBlock.getKeyCode() + 100)
handleMouseClick(slot, k1, clickNum, 3);
else
{
boolean flag2 = k1 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54));
byte b0 = 0;
if (flag2)
{
field_94075_K = slot != null && slot.getHasStack() ? slot.getStack() : null;
b0 = 1;
}
else if (k1 == -999)
b0 = 4;
handleMouseClick(slot, k1, clickNum, b0);
}
field_94068_E = true;
}
else
{
field_94076_q = true;
field_94067_D = clickNum;
field_94077_p.clear();
if (clickNum == 0)
field_94071_C = 0;
else if (clickNum == 1)
field_94071_C = 1;
}
}
field_94072_H = slot;
field_94070_G = l;
field_94073_I = clickNum;
}
}
@@ -1,134 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.gui;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.world.World;
import tconstruct.tools.logic.ToolForgeLogic;
//import tconstruct.client.gui.GuiButtonTool;
@SideOnly(Side.CLIENT)
public class IguanaToolForgeGui extends IguanaToolStationGui
{
int selectedButton;
public IguanaToolForgeGui(InventoryPlayer inventoryplayer, ToolForgeLogic stationlogic, World world, int x, int y, int z)
{
super(inventoryplayer, stationlogic, world, x, y, z);
}
/*
@Override
protected void mouseClicked (int mouseX, int mouseY, int mouseButton)
{
super.mouseClicked(mouseX, mouseY, mouseButton);
if (mouseButton == 0)
{
int gLeft = guiLeft + 68;
int gTop = guiTop + 6;
int gWidth = 102;
int gHeight = 12;
active = mouseX > gLeft && mouseX < gLeft + gWidth && mouseY > gTop && mouseY < gTop + gHeight;
}
}
@Override
public void initGui ()
{
super.initGui();
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
buttonList.clear();
ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0);
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.domain, repair.texture, repair); // Repair
repairButton.enabled = false;
buttonList.add(repairButton);
int offset = TConstructClientRegistry.tierTwoButtons.size();
for (int iter = 0; iter < TConstructClientRegistry.tierTwoButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.tierTwoButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter + 1, cornerX - 110 + 22 * ((iter + 1) % 5), cornerY + 22 * ((iter + 1) / 5), element.buttonIconX, element.buttonIconY, repair.domain,
element.texture, element);
buttonList.add(button);
}
for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter + offset, cornerX - 110 + 22 * ((iter + offset) % 5), cornerY + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY,
repair.domain, element.texture, element);
buttonList.add(button);
}
}
@Override
protected void actionPerformed (GuiButton button)
{
GuiButtonTool b = (GuiButtonTool) button;
((GuiButton) buttonList.get(selectedButton)).enabled = true;
selectedButton = button.id;
button.enabled = false;
setSlotType(b.element.slotType);
iconX = b.element.iconsX;
iconY = b.element.iconsY;
title = "\u00A7n" + b.element.title;
body = b.element.body;
}
@Override
void resetGui ()
{
text.setText("");
selectedButton = 0;
setSlotType(0);
iconX = new int[] { 0, 1, 2, 13 };
iconY = new int[] { 13, 13, 13, 13 };
title = "\u00A7nRepair and Modification";
body = "The main way to repair or change your tools. Place a tool and a material on the left to get started.";
}
@Override
void setSlotType (int type)
{
switch (type)
{
case 0:
slotX = new int[] { 56, 38, 38, 14 }; // Repair
slotY = new int[] { 37, 28, 46, 37 };
break;
case 1:
slotX = new int[] { 56, 56, 56, 14 }; // Three parts
slotY = new int[] { 19, 55, 37, 37 };
break;
case 2:
slotX = new int[] { 56, 56, 14, 14 }; // Two parts
slotY = new int[] { 28, 46, 28, 46 };
break;
case 3:
slotX = new int[] { 38, 47, 56, 14 }; // Double head
slotY = new int[] { 28, 46, 28, 37 };
break;
case 4:
slotX = new int[] { 47, 38, 56, 47 }; // Four parts
slotY = new int[] { 19, 37, 37, 55 };
break;
case 5:
slotX = new int[] { 38, 47, 56, 47 }; // Four parts, double head
slotY = new int[] { 19, 55, 19, 37 };
break;
case 6:
slotX = new int[] { 38, 38, 20, 56 }; // Double head
slotY = new int[] { 28, 46, 28, 28 };
break;
case 7:
slotX = new int[] { 56, 56, 56, 14 }; // Three parts reverse
slotY = new int[] { 19, 37, 55, 37 };
break;
}
toolSlots.resetSlots(slotX, slotY);
}
*/
}
@@ -1,498 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.gui;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import iguanaman.iguanatweakstconstruct.util.HarvestLevels;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import tconstruct.client.gui.NewContainerGui;
import tconstruct.library.client.TConstructClientRegistry;
import tconstruct.library.client.ToolGuiElement;
import tconstruct.library.tools.ToolCore;
import tconstruct.smeltery.inventory.ActiveContainer;
import tconstruct.tools.inventory.ToolStationContainer;
import tconstruct.tools.logic.ToolStationLogic;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.List;
//import tconstruct.client.gui.GuiButtonTool;
@SideOnly(Side.CLIENT)
public class IguanaToolStationGui extends NewContainerGui
{
public ToolStationLogic logic;
public ToolStationContainer toolSlots;
public GuiTextField text;
public String toolName;
public int guiType;
public int[] slotX, slotY, iconX, iconY;
public boolean active;
public String title, body = "";
public IguanaToolStationGui(InventoryPlayer inventoryplayer, ToolStationLogic stationlogic, World world, int x, int y, int z)
{
super((ActiveContainer) stationlogic.getGuiContainer(inventoryplayer, world, x, y, z));
logic = stationlogic;
toolSlots = (ToolStationContainer) container;
text = new GuiTextField(fontRendererObj, xSize / 2 - 5, 8, 30, 12);
text.setMaxStringLength(40);
text.setEnableBackgroundDrawing(false);
text.setVisible(true);
text.setCanLoseFocus(false);
text.setFocused(true);
text.setTextColor(0xffffff);
toolName = "";
resetGui();
Keyboard.enableRepeatEvents(true);
}
@Override
protected void mouseClicked (int mouseX, int mouseY, int mouseButton)
{
super.mouseClicked(mouseX, mouseY, mouseButton);
if (mouseButton == 0)
{
int gLeft = guiLeft + 68;
int gTop = guiTop + 6;
int gWidth = 102;
int gHeight = 12;
active = mouseX > gLeft && mouseX < gLeft + gWidth && mouseY > gTop && mouseY < gTop + gHeight;
}
}
void resetGui ()
{
text.setText("");
guiType = 0;
setSlotType(0);
iconX = new int[] { 0, 1, 2 };
iconY = new int[] { 13, 13, 13 };
title = "\u00A7nRepair and Modification";
body = "The main way to repair or change your tools. Place a tool and a material on the left to get started.";
}
@Override
public void initGui ()
{
super.initGui();
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
/*
buttonList.clear();
ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0);
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.domain, repair.texture, repair); // Repair
repairButton.enabled = false;
buttonList.add(repairButton);
for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter, cornerX - 110 + 22 * (iter % 5), cornerY + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, repair.domain, element.texture,
element);
buttonList.add(button);
}*/
}
@Override
protected void actionPerformed (GuiButton button)
{
((GuiButton) buttonList.get(guiType)).enabled = true;
guiType = button.id;
button.enabled = false;
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(guiType);
setSlotType(element.slotType);
iconX = element.iconsX;
iconY = element.iconsY;
title = "\u00A7n" + element.title;
body = element.body;
}
void setSlotType (int type)
{
switch (type)
{
case 0:
slotX = new int[] { 56, 38, 38 }; // Repair
slotY = new int[] { 37, 28, 46 };
break;
case 1:
slotX = new int[] { 56, 56, 56 }; // Three parts
slotY = new int[] { 19, 55, 37 };
break;
case 2:
slotX = new int[] { 56, 56, 14 }; // Two parts
slotY = new int[] { 28, 46, 37 };
break;
case 3:
slotX = new int[] { 38, 47, 56 }; // Double head
slotY = new int[] { 28, 46, 28 };
break;
case 7:
slotX = new int[] { 56, 56, 56 }; // Three parts reverse
slotY = new int[] { 19, 37, 55 };
break;
}
toolSlots.resetSlots(slotX, slotY);
}
@Override
public void updateScreen ()
{
super.updateScreen();
text.updateCursorCounter();
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
@Override
protected void drawGuiContainerForegroundLayer (int par1, int par2)
{
fontRendererObj.drawString(StatCollector.translateToLocal(logic.getInvName()), 6, 8, 0x000000);
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 0x000000);
fontRendererObj.drawString(toolName + "_", xSize / 2 - 18, 8, 0xffffff);
if (logic.isStackInSlot(0))
drawToolStats();
else
drawToolInformation();
//this.fontRenderer.drawString("Namebox active: "+active, this.xSize / 2 - 18, -10, 0xffffff);
}
void drawToolStats ()
{
ItemStack stack = logic.getStackInSlot(0);
if (stack.getItem() instanceof ToolCore)
{
ToolCore tool = (ToolCore) stack.getItem();
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
drawCenteredString(fontRendererObj, "\u00A7n" + tool.getToolName(), xSize + 63, 8, 0xffffff);
drawModularToolStats(stack, tool, tags);
}
}
void drawModularToolStats (ItemStack stack, ToolCore tool, NBTTagCompound tags)
{
List<String> categories = Arrays.asList(tool.getTraits());
final int durability = tags.getInteger("Damage");
final int maxDur = tags.getInteger("TotalDurability");
int availableDurability = maxDur - durability;
//Durability
int base = 24;
int offset = 0;
if (maxDur > 0)
if (maxDur >= 10000)
{
fontRendererObj.drawString("Durability:", xSize + 8, base + offset * 11, 0xffffff);
offset++;
fontRendererObj.drawString("- " + availableDurability + "/" + maxDur, xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
else
{
fontRendererObj.drawString("Durability: " + availableDurability + "/" + maxDur, xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
final float stonebound = tags.getFloat("Shoddy");
//Attack
if (categories.contains("weapon"))
{
int attack = tags.getInteger("Attack");
float stoneboundDamage = (float) Math.log(durability / 72f + 1) * -2 * stonebound;
attack += stoneboundDamage;
attack *= tool.getDamageModifier();
if (attack < 1)
attack = 1;
String heart = attack == 2 ? " Heart" : " Hearts";
if (attack % 2 == 0)
fontRendererObj.drawString("Attack: " + attack / 2 + heart, xSize + 8, base + offset * 10, 0xffffff);
else
fontRendererObj.drawString("Attack: " + attack / 2f + heart, xSize + 8, base + offset * 10, 0xffffff);
offset++;
if (stoneboundDamage != 0)
{
heart = stoneboundDamage == 2 ? " Heart" : " Hearts";
String bloss = stoneboundDamage > 0 ? "Bonus: " : "Loss: ";
fontRendererObj.drawString(bloss + (int) stoneboundDamage / 2 + heart, xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
offset++;
}
if (categories.contains("bow"))
{
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
int drawSpeed = tags.getInteger("DrawSpeed");
float flightSpeed = tags.getFloat("FlightSpeed");
float trueDraw = drawSpeed / 20f * flightSpeed;
fontRendererObj.drawString("Draw Speed: " + df.format(trueDraw) + "s", xSize + 8, base + offset * 10, 0xffffff);
offset++;
fontRendererObj.drawString("Arrow Speed: " + df.format(flightSpeed) + "x", xSize + 8, base + offset * 10, 0xffffff);
offset++;
offset++;
}
if (categories.contains("ammo"))
{
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
int attack = tags.getInteger("Attack");
float mass = tags.getFloat("Mass");
tags.getFloat("BreakChance");
float accuracy = tags.getFloat("Accuracy");
fontRendererObj.drawString("Base Attack:", xSize + 8, base + offset * 10, 0xffffff);
offset++;
String heart = attack == 2 ? " Heart" : " Hearts";
if (attack % 2 == 0)
fontRendererObj.drawString("- " + attack / 2 + heart, xSize + 8, base + offset * 10, 0xffffff);
else
fontRendererObj.drawString("- " + attack / 2f + heart, xSize + 8, base + offset * 10, 0xffffff);
offset++;
int minAttack = attack;
int maxAttack = attack * 2;
heart = " Hearts";
fontRendererObj.drawString("Shortbow Attack:", xSize + 8, base + offset * 10, 0xffffff);
offset++;
fontRendererObj.drawString(df.format(minAttack / 2f) + "-" + df.format(maxAttack / 2f) + heart, xSize + 8, base + offset * 10, 0xffffff);
offset++;
offset++;
fontRendererObj.drawString("Weight: " + df.format(mass), xSize + 8, base + offset * 10, 0xffffff);
offset++;
fontRendererObj.drawString("Accuracy: " + df.format(accuracy - 4) + "%", xSize + 8, base + offset * 10, 0xffffff);
offset++;
/*this.fontRenderer.drawString("Chance to break: " + df.format(shatter)+"%", xSize + 8, base + offset * 10, 0xffffff);
offset++;*/
offset++;
}
//Mining
if (categories.contains("dualharvest"))
{
float mineSpeed = tags.getInteger("MiningSpeed") / 100f;
float stoneboundSpeed = (float) Math.log(durability / 90f + 1) * 2 * stonebound;
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
float trueSpeed = mineSpeed + stoneboundSpeed;
float trueSpeed2 = mineSpeed + stoneboundSpeed;
fontRendererObj.drawString("Mining Speeds: ", xSize + 8, base + offset * 10, 0xffffff);
offset++;
fontRendererObj.drawString("- " + df.format(trueSpeed) + ", " + df.format(trueSpeed2), xSize + 8, base + offset * 10, 0xffffff);
offset++;
if (stoneboundSpeed != 0)
{
String bloss = stoneboundSpeed > 0 ? "Bonus: " : "Loss: ";
fontRendererObj.drawString(bloss + df.format(stoneboundSpeed), xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
offset++;
fontRendererObj.drawString("Harvest Levels:", xSize + 8, base + offset * 10, 0xffffff);
offset++;
fontRendererObj
.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel")) + ", " + getHarvestLevelName(tags.getInteger("HarvestLevel2")), xSize + 8, base + offset * 10, 0xffffff);
offset++;
offset++;
}
else if (categories.contains("harvest"))
{
float mineSpeed = tags.getInteger("MiningSpeed");
int heads = 1;
if (tags.hasKey("MiningSpeed2"))
{
mineSpeed += tags.getInteger("MiningSpeed2");
heads++;
}
if (tags.hasKey("MiningSpeedHandle"))
{
mineSpeed += tags.getInteger("MiningSpeedHandle");
heads++;
}
if (tags.hasKey("MiningSpeedExtra"))
{
mineSpeed += tags.getInteger("MiningSpeedExtra");
heads++;
}
float trueSpeed = mineSpeed / (heads * 100f);
float stoneboundSpeed = (float) Math.log(durability / 90f + 1) * 2 * stonebound;
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
trueSpeed += stoneboundSpeed;
if (trueSpeed < 0)
trueSpeed = 0;
fontRendererObj.drawString("Mining Speed: " + df.format(trueSpeed), xSize + 8, base + offset * 10, 0xffffff);
offset++;
if (stoneboundSpeed != 0)
{
String bloss = stoneboundSpeed > 0 ? "Bonus: " : "Loss: ";
fontRendererObj.drawString(bloss + df.format(stoneboundSpeed), xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
fontRendererObj.drawString("Mining Level: " + getHarvestLevelName(tags.getInteger("HarvestLevel")), xSize + 8, base + offset * 10, 0xffffff);
offset++;
offset++;
}
else if (categories.contains("utility"))
{
float mineSpeed = tags.getInteger("MiningSpeed");
float trueSpeed = mineSpeed / 100f;
fontRendererObj.drawString("Usage Speed: " + trueSpeed, xSize + 8, base + offset * 10, 0xffffff);
offset++;
offset++;
}
int modifiers = tags.getInteger("Modifiers");
if (modifiers > 0)
{
fontRendererObj.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
if (tags.hasKey("Tooltip1"))
fontRendererObj.drawString("Modifiers:", xSize + 8, base + offset * 10, 0xffffff);
boolean displayToolTips = true;
int tipNum = 0;
int written = 0;
while (displayToolTips)
{
tipNum++;
String tooltip = "ModifierTip" + tipNum;
if (tags.hasKey(tooltip))
{
String tipName = tags.getString(tooltip);
if (!tipName.trim().equals(""))
fontRendererObj.drawString("- " + tipName, xSize + 8, base + (offset + ++written) * 10, 0xffffff);
}
else
displayToolTips = false;
}
}
void drawToolInformation ()
{
drawCenteredString(fontRendererObj, title, xSize + 63, 8, 0xffffff);
fontRendererObj.drawSplitString(body, xSize + 8, 24, 115, 0xffffff);
}
String getHarvestLevelName (int num)
{
return HarvestLevels.getHarvestLevelName(num);
}
private static final ResourceLocation background = new ResourceLocation("tinker", "textures/gui/toolstation.png");
private static final ResourceLocation icons = new ResourceLocation("tinker", "textures/gui/icons.png");
private static final ResourceLocation description = new ResourceLocation("tinker", "textures/gui/description.png");
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
@Override
protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
{
// Draw the background
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(background);
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
if (active)
drawTexturedModalRect(cornerX + 62, cornerY, 0, ySize, 112, 22);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(icons);
// Draw the slots
for (int i = 0; i < slotX.length; i++)
{
drawTexturedModalRect(cornerX + slotX[i] - 4, cornerY + slotY[i] - 4, 140, 212, 28, 28);
if (!logic.isStackInSlot(i + 1))
drawTexturedModalRect(cornerX + slotX[i], cornerY + slotY[i], 18 * iconX[i], 18 * iconY[i], 18, 18);
}
// Draw description
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(description);
cornerX = (width + xSize) / 2;
cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, 126, ySize + 30);
}
@Override
protected void keyTyped (char par1, int keyCode)
{
if (keyCode == 1 || !active && keyCode == mc.gameSettings.keyBindInventory.getKeyCode())
{
logic.setToolname("");
updateServer("");
Keyboard.enableRepeatEvents(false);
mc.thePlayer.closeScreen();
}
else if (active)
{
text.textboxKeyTyped(par1, keyCode);
toolName = text.getText().trim();
logic.setToolname(toolName);
updateServer(toolName);
}
}
void updateServer (String name)
{
// TODO: Update networking
/*ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
DataOutputStream outputStream = new DataOutputStream(bos);
try
{
outputStream.writeByte(1);
outputStream.writeInt(logic.getWorldObj().provider.dimensionId);
outputStream.writeInt(logic.xCoord);
outputStream.writeInt(logic.yCoord);
outputStream.writeInt(logic.zCoord);
outputStream.writeUTF(name);
}
catch (Exception ex)
{
ex.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "TConstruct";
packet.data = bos.toByteArray();
packet.length = bos.size();
PacketDispatcher.sendPacketToServer(packet);*/
}
/*protected void mouseClicked(int par1, int par2, int par3)
{
super.mouseClicked(par1, par2, par3);
text.mouseClicked(par1, par2, par3);
}*/
}
@@ -1,164 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.items;
import cpw.mods.fml.common.eventhandler.Event;
import iguanaman.iguanatweakstconstruct.old.IguanaItems;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.IFluidBlock;
public class ClayBucket extends ItemBucket
{
protected Block isFull = Blocks.air;
public ClayBucket(Block contents)
{
super(contents);
isFull = contents;
}
/**
* Called whenever this prefix is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
boolean flag = isFull == Blocks.air;
MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag);
if (movingobjectposition == null)
return par1ItemStack;
else
{
FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, movingobjectposition);
if (MinecraftForge.EVENT_BUS.post(event))
return par1ItemStack;
if (event.getResult() == Event.Result.ALLOW)
{
if (par3EntityPlayer.capabilities.isCreativeMode)
return par1ItemStack;
if (--par1ItemStack.stackSize <= 0)
return event.result;
if (!par3EntityPlayer.inventory.addItemStackToInventory(event.result))
par3EntityPlayer.dropPlayerItemWithRandomChoice(event.result, false);
return par1ItemStack;
}
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
Block bf = par2World.getBlock(i, j, k);
if (bf instanceof IFluidBlock)
{
Fluid fl = FluidRegistry.lookupFluidForBlock(bf);
if (fl != null)
{
String name = fl.getUnlocalizedName().toLowerCase();
if (name.contains("witchwater") || !(name.contains("water") || name.contains("lava") || name.contains("milk")))
return par1ItemStack;
}
}
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
return par1ItemStack;
if (flag)
{
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
return par1ItemStack;
Material material = par2World.getBlock(i, j, k).getMaterial();
int blockMeta = par2World.getBlockMetadata(i, j, k);
if (material == Material.water && blockMeta == 0)
{
par2World.setBlockToAir(i, j, k);
if (par3EntityPlayer.capabilities.isCreativeMode)
return par1ItemStack;
if (--par1ItemStack.stackSize <= 0)
return new ItemStack(IguanaItems.clayBucketWater);
if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(IguanaItems.clayBucketWater)))
par3EntityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(IguanaItems.clayBucketWater, 1, 0) , false);
return par1ItemStack;
}
if (material == Material.lava && blockMeta == 0)
{
par2World.setBlockToAir(i, j, k);
if (par3EntityPlayer.capabilities.isCreativeMode)
return par1ItemStack;
if (--par1ItemStack.stackSize <= 0)
return new ItemStack(IguanaItems.clayBucketLava);
if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(IguanaItems.clayBucketLava)))
par3EntityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(IguanaItems.clayBucketLava, 1, 0), false);
return par1ItemStack;
}
}
else
{
if (isFull == Blocks.air)
return new ItemStack(IguanaItems.clayBucketFired);
if (movingobjectposition.sideHit == 0)
--j;
if (movingobjectposition.sideHit == 1)
++j;
if (movingobjectposition.sideHit == 2)
--k;
if (movingobjectposition.sideHit == 3)
++k;
if (movingobjectposition.sideHit == 4)
--i;
if (movingobjectposition.sideHit == 5)
++i;
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
return par1ItemStack;
if (tryPlaceContainedLiquid(par2World, i, j, k) && !par3EntityPlayer.capabilities.isCreativeMode)
if (isFull == Blocks.flowing_lava)
{
--par1ItemStack.stackSize;
return par1ItemStack;
}
else
return new ItemStack(IguanaItems.clayBucketFired);
}
}
else if (isFull == Blocks.air && movingobjectposition.entityHit instanceof EntityCow)
return new ItemStack(IguanaItems.clayBucketMilk);
return par1ItemStack;
}
}
}
@@ -1,44 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import tconstruct.smeltery.items.FilledBucket;
public class ClayBucketFilled extends FilledBucket {
public ClayBucketFilled(Block contents) {
super(contents);
}
/**
* Called whenever this prefix is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
ItemStack result = super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
if (result.getItem() == Items.bucket) {
--par1ItemStack.stackSize;
return par1ItemStack;
}
return result;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons (IIconRegister iconRegister)
{
icons = new IIcon[textureNames.length];
for (int i = 0; i < icons.length; ++i)
icons[i] = iconRegister.registerIcon("iguanatweakstconstruct:clayBucket_" + textureNames[i]);
}
}
@@ -1,24 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.items;
import iguanaman.iguanatweakstconstruct.old.IguanaItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBucketMilk;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ClayBucketMilk extends ItemBucketMilk {
public ClayBucketMilk() {
super();
}
@Override
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
ItemStack result = super.onEaten(par1ItemStack, par2World, par3EntityPlayer);
if (result.getItem()== Items.bucket) return new ItemStack(IguanaItems.clayBucketFired);
return result;
}
}
@@ -1,108 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import iguanaman.iguanatweakstconstruct.reference.Config;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSkull;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import java.util.List;
public class IguanaItemSkull extends ItemSkull {
private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper", "enderman", "pigman", "blaze"};
public static final String[] field_94587_a = new String[] {"skeleton", "wither", "zombie", "steve", "creeper", "skull_enderman", "skull_pigman", "skull_blaze"};
@SideOnly(Side.CLIENT)
private IIcon field_94586_c [];
public IguanaItemSkull() {
super();
}
/**
* Returns the unlocalized name of this prefix. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
@Override
public String getUnlocalizedName(ItemStack par1ItemStack)
{
int i = par1ItemStack.getItemDamage();
if (i < 0 || i >= skullTypes.length)
i = 0;
if (i >= 5)
return "iguanatweakstconstruct:" + field_94587_a[i];
else
return super.getUnlocalizedName() + "." + skullTypes[i];
}
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int j = 0; j < skullTypes.length; ++j)
par3List.add(new ItemStack(par1, 1, j));
}
/**
* allows items to add custom lines of information to the mouseover description
*/
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
if (Config.mobHeadPickaxeBoost)
{
int meta = par1ItemStack.getItemDamage();
switch (meta)
{
case 0: par3List.add("Use on: Copper pick"); break;
case 1: par3List.add("Use on: Copper, Iron, Bronze or Alumite pick"); break;
case 2: par3List.add("Use on: Copper pick"); break;
case 4: par3List.add("Use on: Copper or Iron pick"); break;
case 5: par3List.add("Use on: Copper, Iron or Bronze pick"); break;
}
if (meta != 3 && meta <= 5) par3List.add("\u00a76Pickaxe booster (+1 Mining Level)");
}
}
@Override
@SideOnly(Side.CLIENT)
/**
* Gets an icon index based on an prefix's damage value
*/
public IIcon getIconFromDamage(int par1)
{
if (par1 < 0 || par1 >= skullTypes.length)
par1 = 0;
return field_94586_c[par1];
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
field_94586_c = new IIcon[field_94587_a.length];
for (int i = 0; i < field_94587_a.length; ++i)
if (i >= 5)
field_94586_c[i] = par1IconRegister.registerIcon("iguanatweakstconstruct:" + field_94587_a[i]);
else
field_94586_c[i] = par1IconRegister.registerIcon(getIconString() + "_" + field_94587_a[i]);
}
}
@@ -1,39 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.List;
public class IguanaMetalPattern extends IguanaPattern {
public IguanaMetalPattern(int id, String patternType, String folder)
{
super(id, patternName, getPatternNames(patternType), folder);
}
protected static String[] getPatternNames (String partType)
{
String[] names = new String[patternName.length];
for (int i = 0; i < patternName.length; i++)
if (!patternName[i].equals(""))
names[i] = partType + patternName[i];
else
names[i] = "";
return names;
}
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", "", "", "arrowhead", "gem" };
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubItems (Item item, CreativeTabs tab, List list)
{
for (int i = 0; i < patternName.length; i++)
if (!patternName[i].equals(""))
list.add(new ItemStack(item, 1, i));
}
}
@@ -1,127 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.items;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import org.lwjgl.input.Keyboard;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.tools.items.Pattern;
import java.util.List;
public class IguanaPattern extends Pattern {
public IguanaPattern(String patternType, String folder) {
super(patternType, folder);
}
public IguanaPattern(int id, String[] names, String[] patternTypes,
String folder) {
super(names, patternTypes, folder);
}
/**
* allows items to add custom lines of information to the mouseover description
*/
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
PatternBuilder pb = PatternBuilder.instance;
par3List.add("Valid materials:");
if (par1ItemStack.getItemDamage() == 23)
par3List.add("String");
else if (par1ItemStack.getItemDamage() == 24)
{
par3List.add("Feather");
par3List.add("Leaf");
par3List.add("Slime");
} else
for (tconstruct.library.tools.ToolMaterial material : TConstructRegistry.toolMaterials.values())
if (!par3List.contains(material.displayName))
{
ItemStack shard = pb.getShardFromSet(material.name());
if (shard != null)
{
shard.stackSize = getPatternCost(par1ItemStack);
if (pb.getToolPart(shard, par1ItemStack, null) != null)
if (par3List.size() < 7 || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))
par3List.add(material.displayName);
else
{
par3List.add("\u00A7o<Hold SHIFT for more>");
break;
}
}
}
}
/*
@Override
public int getPatternCost (ItemStack pattern)
{
switch (pattern.getItemDamage())
{
case 0:
return 2;
case 1:
return IguanaConfig.patternCostToolRod;
case 2:
return IguanaConfig.patternCostPickaxeHead;
case 3:
return IguanaConfig.patternCostShovelHead;
case 4:
return IguanaConfig.patternCostHatchetHead;
case 5:
return IguanaConfig.patternCostSwordBlade;
case 6:
return IguanaConfig.patternCostWideGuard;
case 7:
return IguanaConfig.patternCostHandGuard;
case 8:
return IguanaConfig.patternCostCrossbar;
case 9:
return IguanaConfig.patternCostBinding;
case 10:
return IguanaConfig.patternCostFrypanHead;
case 11:
return IguanaConfig.patternCostSignHead;
case 12:
return IguanaConfig.patternCostKnifeBlade;
case 13:
return IguanaConfig.patternCostChiselHead;
case 14:
return IguanaConfig.patternCostToughRod;
case 15:
return IguanaConfig.patternCostToughBinding;
case 16:
return IguanaConfig.patternCostHeavyPlate;
case 17:
return IguanaConfig.patternCostBroadAxeHead;
case 18:
return IguanaConfig.patternCostScytheBlade;
case 19:
return IguanaConfig.patternCostExcavatorHead;
case 20:
return IguanaConfig.patternCostLargeSwordBlade;
case 21:
return IguanaConfig.patternCostHammerHead;
case 22:
return IguanaConfig.patternCostFullGuard;
case 23:
return IguanaConfig.patternCostBowstring;
case 24:
return IguanaConfig.patternCostFletching;
case 25:
return IguanaConfig.patternCostArrowHead;
default:
return 0;
}
}
*/
}
@@ -1,66 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.items;
import iguanaman.iguanatweakstconstruct.old.IguanaConfig;
import iguanaman.iguanatweakstconstruct.util.HarvestLevels;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import tconstruct.library.TConstructRegistry;
import tconstruct.tools.items.ToolPart;
import java.util.List;
public class IguanaToolPart extends ToolPart {
public IguanaToolPart(String textureType, String name) {
super(textureType, name);
}
/**
* allows items to add custom lines of information to the mouseover description
*/
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
tconstruct.library.tools.ToolMaterial material = TConstructRegistry.getMaterial(par1ItemStack.getItemDamage());
if (!IguanaConfig.allowStoneTools && material.materialName.equals("Stone"))
{
par3List.add("\u00a74Can only be used to make casts,");
par3List.add("\u00a74cannot be used to make a tool");
}
else
{
if (!material.ability.equals("")) par3List.add(material.style() + material.ability);
if (partName.equals("PickHead") || partName.equals("HammerHead") || partName.equals("ShovelHead")
|| partName.equals("ExcavatorHead"))
par3List.add("Mining Level: " + HarvestLevels.getHarvestLevelName(material.harvestLevel));
if (
partName.equals("PickHead") || partName.equals("HammerHead") || partName.equals("ShovelHead") || partName.equals("ExcavatorHead")
|| partName.equals("AxeHead") || partName.equals("LumberHead") || partName.equals("SwordBlade") || partName.equals("KnifeBlade")
|| partName.equals("FrypanHead") || partName.equals("SignHead") || partName.equals("ScytheHead") || partName.equals("LargeSwordBlade")
|| partName.equals("ArrowHead")
)
par3List.add("Damage: " + material.attack);
if (partName.equals("ToolRod") || partName.equals("ToughRod"))
par3List.add("Handle Modifier: " + Float.toString(material.handleModifier));
else if (!partName.equals("Binding"))
{
par3List.add("Speed: " + material.miningspeed);
par3List.add("Durability: " + material.durability);
}
if (IguanaConfig.partReplacement)
if (material.ability.equals("Writable") || material.ability.equals("Thaumic"))
{
par3List.add("\u00a74Cannot be replaced once added,");
par3List.add("\u00a74unless a modifier is available");
} else
par3List.add("\u00a76Parts can be replaced");
}
}
}
@@ -1,61 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.ActiveToolMod;
import tconstruct.library.tools.ToolCore;
import java.util.Arrays;
import java.util.List;
public class IguanaActiveToolMod extends ActiveToolMod {
static List<Material> materialBlacklist = Arrays.asList(
Material.leaves, Material.vine, Material.circuits,
Material.glass, Material.piston, Material.snow
);
/* Harvesting */
@Override
public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLivingBase entity)
{
if (!(entity instanceof EntityPlayer)) return false;
Block block = entity.worldObj.getBlock(x, y, z);
int meta = entity.worldObj.getBlockMetadata(x, y, z);
if (block == null || materialBlacklist.contains(block.getMaterial())) return false;
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
int miningSpeed = tags.hasKey("MiningSpeed") ? tags.getInteger("MiningSpeed"): -1;
int miningSpeed2 = tags.hasKey("MiningSpeed2") ? tags.getInteger("MiningSpeed2"): -1;
int miningSpeedHandle = tags.hasKey("MiningSpeedHandle") ? tags.getInteger("MiningSpeedHandle"): -1;
int miningSpeedExtra = tags.hasKey("MiningSpeedExtra") ? tags.getInteger("MiningSpeedExtra"): -1;
if (miningSpeed > 0) tags.setInteger("MiningSpeed", miningSpeed * 2);
if (miningSpeed2 > 0) tags.setInteger("MiningSpeed2", miningSpeed2 * 2);
if (miningSpeedHandle > 0) tags.setInteger("MiningSpeedHandle", miningSpeedHandle * 2);
if (miningSpeedExtra > 0) tags.setInteger("MiningSpeedExtra", miningSpeedExtra * 2);
//IguanaLog.log(tool.canHarvestBlock(prefix) + " " + Float.toString(tool.getStrVsBlock(stack, prefix, meta)));
// TODO: Find replacement for canHarvestBlock and getStrVsBlock
//if (tool.canHarvestBlock(prefix) && tool.getStrVsBlock(stack, prefix, meta) > 1f)
//IguanaLog.log("xp added");
// TODO: Find replacement for canHarvestBlock and getStrVsBlock
//IguanaLevelingLogic.addXP(stack, (EntityPlayer)entity, 1L);
if (miningSpeed > 0) tags.setInteger("MiningSpeed", miningSpeed);
if (miningSpeed2 > 0) tags.setInteger("MiningSpeed2", miningSpeed2);
if (miningSpeedHandle > 0) tags.setInteger("MiningSpeedHandle", miningSpeedHandle);
if (miningSpeedExtra > 0) tags.setInteger("MiningSpeedExtra", miningSpeedExtra);
return false;
}
}
@@ -1,133 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.modifier.IModifyable;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.ToolCore;
import java.util.Arrays;
import java.util.List;
public class IguanaModAttack extends ItemModifier {
String tooltipName;
int increase;
int max = 120;
int amount = Math.round(max / 3f);
String guiType;
public IguanaModAttack(String type, ItemStack[] items, int effect, int inc)
{
super(items, effect, "ModAttack");
tooltipName = "\u00a7fSharpness";
guiType = type;
increase = inc;
}
public boolean canModify (ItemStack tool, ItemStack[] input, boolean automated)
{
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (automated)
{
if (tags.hasKey(key))
{
int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= max)
return true;
} else
return true;
}
else
{
if (!tags.hasKey(key))
return tags.getInteger("Modifiers") > 0;
int keyPair[] = tags.getIntArray(key);
if (keyPair[0] % amount == 0)
return tags.getInteger("Modifiers") > 0;
if (keyPair[0] + increase <= keyPair[1])
return true;
}
return false;
}
@Override
public boolean canModify (ItemStack tool, ItemStack[] input)
{
return canModify(tool, input, false);
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.hasKey(key))
{
int[] keyPair = tags.getIntArray(key);
if (keyPair[0] % amount == 0)
{
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
}
if (keyPair[0] + increase >= keyPair[1])
{
int attack = tags.getInteger("Attack");
attack += 1;
tags.setInteger("Attack", attack);
keyPair[1] += amount;
}
keyPair[0] += increase;
tags.setIntArray(key, keyPair);
updateModTag(tool, keyPair);
}
else
{
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
String modName = "\u00a7f" + guiType + " (" + increase + "/" + max + ")";
int tooltipIndex = addToolTip(tool, tooltipName, modName);
int[] keyPair = new int[] { increase, amount, tooltipIndex };
tags.setIntArray(key, keyPair);
}
}
void updateModTag (ItemStack tool, int[] keys)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
String tip = "ModifierTip" + keys[2];
String modName = "\u00a7f" + guiType + " (" + keys[0] + "/" + keys[1] + ")";
tags.setString(tip, modName);
}
@Override
public boolean validType (IModifyable input)
{
return input.getModifyType().equals("Tool");
/*List list = Arrays.asList(tool.toolCategories());
return list.contains("melee") || list.contains("harvest") || list.contains("ammo");*/
}
public boolean nerfType (IModifyable input)
{
List<String> list = Arrays.asList(input.getTraits());
return list.contains("throwing") || list.contains("ammo");
}
}
@@ -1,24 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import net.minecraft.item.ItemStack;
import tconstruct.library.tools.ToolCore;
import tconstruct.modifiers.tools.ModBlaze;
public class IguanaModBlaze extends ModBlaze {
public IguanaModBlaze(ItemStack[] items, int effect, int[] inc) {
super(effect, items, inc);
}
@Override
public boolean canModify (ItemStack tool, ItemStack[] input)
{
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
else
return true;
}
}
@@ -1,60 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.ToolCore;
import tconstruct.tools.TinkerTools;
public class IguanaModClean extends ItemModifier {
public IguanaModClean() {
super(new ItemStack[] { new ItemStack(TinkerTools.materials, 1, 25) }, 0, "");
}
public IguanaModClean(ItemStack[] items, int effect, String dataKey) {
super(items, effect, dataKey);
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input) { return true; }
@Override
public void modify(ItemStack[] input, ItemStack tool) {
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
ToolCore toolClass = (ToolCore)tool.getItem();
//get old tool part materials
int oldHead = tags.getInteger("Head");
int oldHandle = tags.getInteger("Handle");
int oldAccessory = tags.getInteger("Accessory");
int oldExtra = tags.getInteger("Extra");
//get current prefix parts
ItemStack headStack = new ItemStack(toolClass.getHeadItem(), 1, oldHead);
ItemStack handleStack = new ItemStack(toolClass.getHandleItem(), 1, oldHandle);
ItemStack accessoryStack = null;
if (toolClass.getAccessoryItem() != null) accessoryStack = new ItemStack(toolClass.getAccessoryItem(), 1, oldAccessory);
ItemStack extraStack = null;
if (toolClass.getExtraItem() != null) extraStack = new ItemStack(toolClass.getExtraItem(), 1, oldExtra);
// Get tool name
String name = "";
if (tags.hasKey("display"))
{
NBTTagCompound displayTags = tags.getCompoundTag("display");
if (displayTags.hasKey("Name")) name = displayTags.getString("Name");
}
// Create blank tool
Log.info("replacing tool");
tool = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, extraStack, name);
}
@Override
public void addMatchingEffect (ItemStack tool) {}
}
@@ -1,107 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import iguanaman.iguanatweakstconstruct.util.HarvestLevels;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.items.tools.Hammer;
import tconstruct.items.tools.Pickaxe;
import tconstruct.library.modifier.ItemModifier;
import java.util.ArrayList;
import java.util.List;
public class IguanaModHeads extends ItemModifier {
String tooltipName;
String color;
int miningLevel;
public IguanaModHeads(ItemStack[] items, int effect, int level, String k, String tip, String c)
{
super(items, effect, k);
miningLevel = level;
tooltipName = tip;
color = c;
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.hasKey("MobHead")) return false;
if (tool.getItem() instanceof Pickaxe || tool.getItem() instanceof Hammer)
{
if (tags.hasKey("HarvestLevelModified")) return false;
int mLevel = tags.getInteger("HarvestLevel");
if (mLevel > 1 && mLevel < miningLevel) return true;
}
return false;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean("MobHead", true);
tags.setBoolean(key, true);
if (tool.getItem() instanceof Pickaxe)
{
tags.setInteger("HarvestLevel", tags.getInteger("HarvestLevel") + 1);
tags.setBoolean("HarvestLevelModified", true);
overwriteToolTip(tool);
}
String modTip = color + key;
addToolTip(tool, tooltipName, modTip);
}
public void overwriteToolTip(ItemStack tool)
{
NBTTagCompound toolTag = tool.getTagCompound().getCompoundTag("InfiTool");
//tooltip lists
List<String> tips = new ArrayList<String>();
List<String> modifierTips = new ArrayList<String>();
tips.add("Mining Level: " + HarvestLevels.getHarvestLevelName(toolTag.getInteger("HarvestLevel")));
modifierTips.add("");
//get and remove tooltips
int tipNum = 0;
while (true)
{
String tip = "Tooltip" + ++tipNum;
if (toolTag.hasKey(tip))
{
String tipString = toolTag.getString(tip);
if (!tipString.startsWith("Head XP:") && !tipString.startsWith("Boost XP:")
&& !tipString.startsWith("Mining Level:") && !tipString.contains("Requires boost"))
{
tips.add(toolTag.getString(tip));
modifierTips.add(toolTag.getString("ModifierTip" + tipNum));
}
toolTag.removeTag(tip);
toolTag.removeTag("ModifierTip" + tipNum);
}
else break;
}
//write tips
for (int i = 1; i <= tips.size(); ++i)
if (tips.get(i - 1) != null)
{
toolTag.setString("Tooltip" + i, tips.get(i - 1));
if (modifierTips.get(i - 1) != null)
toolTag.setString("ModifierTip" + i, modifierTips.get(i - 1));
else
toolTag.setString("ModifierTip" + i, "");
}
}
}
@@ -1,23 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import net.minecraft.item.ItemStack;
import tconstruct.library.tools.ToolCore;
import tconstruct.modifiers.tools.ModLapis;
public class IguanaModLapis extends ModLapis
{
public IguanaModLapis(ItemStack[] items, int effect, int[] inc) {
super(effect, items, inc);
}
@Override
public boolean canModify (ItemStack tool, ItemStack[] input) {
return super.canModify(tool, input);
}
@Override
public void midStreamModify (ItemStack tool, ToolCore toolItem) {
}
}
@@ -1,23 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import net.minecraft.item.ItemStack;
import tconstruct.library.tools.ToolCore;
import tconstruct.modifiers.tools.ModPiston;
public class IguanaModPiston extends ModPiston
{
public IguanaModPiston(ItemStack[] items, int effect, int[] inc) {
super(effect, items,inc);
}
@Override
public boolean canModify (ItemStack tool, ItemStack[] input) {
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
else
return true;
}
}
@@ -1,222 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import iguanaman.iguanatweakstconstruct.reference.Config;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.items.tools.Hammer;
import tconstruct.items.tools.Pickaxe;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.modifier.IModifyable;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.ToolCore;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class IguanaModRedstone extends ItemModifier {
String tooltipName;
int increase;
int max;
public IguanaModRedstone(ItemStack[] items, int effect, int inc) {
super(items, effect, "Redstone");
tooltipName = "\u00a74Haste";
increase = inc;
max = 50;
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
return canModify(tool, input, false);
}
public boolean canModify (ItemStack tool, ItemStack[] input, boolean auto)
{
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
if (auto) return true;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key))
return tags.getInteger("Modifiers") > 0;
int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= keyPair[1])
return true;
else if (keyPair[0] == keyPair[1])
return tags.getInteger("Modifiers") > 0;
else
return false;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
int[] keyPair;
if (tags.hasKey(key))
{
keyPair = tags.getIntArray(key);
if (keyPair[0] % max == 0)
{
keyPair[0] += increase;
keyPair[1] += max;
tags.setIntArray(key, keyPair);
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
}
else
{
keyPair[0] += increase;
tags.setIntArray(key, keyPair);
}
updateModTag(tool, keyPair);
}
else
{
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
String modName = "\u00a74Redstone (" + increase + "/" + max + ")";
int tooltipIndex = addToolTip(tool, tooltipName, modName);
keyPair = new int[] { increase, max, tooltipIndex };
tags.setIntArray(key, keyPair);
}
// Get current xp as a percentage
float xpPercentage = -1f;
if (tags.hasKey("ToolEXP"))
{
//int requiredXp = IguanaLevelingLogic.getRequiredXp(tool, tags, false);
long currentXp = tags.getLong("ToolEXP");
//xpPercentage = (float)currentXp / (float)requiredXp;
}
// Get current pick xp as a percentage
float headXpPercentage = -1f;
if (tags.hasKey("HeadEXP"))
{
//int requiredXp = IguanaLevelingLogic.getRequiredXp(tool, tags, true);
long currentXp = tags.getLong("HeadEXP");
//headXpPercentage = (float)currentXp / (float)requiredXp;
}
int miningSpeed = tags.getInteger("MiningSpeed");
miningSpeed += increase * 4;
tags.setInteger("MiningSpeed", miningSpeed);
if (tags.hasKey("MiningSpeed2"))
{
int miningSpeed2 = tags.getInteger("MiningSpeed2");
miningSpeed2 += increase * 4;
tags.setInteger("MiningSpeed2", miningSpeed2);
}
if (tags.hasKey("DrawSpeed"))
{
//int drawSpeed = tags.getInteger("DrawSpeed");
int baseDrawSpeed = tags.getInteger("BaseDrawSpeed");
int drawSpeed = (int) (baseDrawSpeed - 0.1f * baseDrawSpeed * (keyPair[0] / 50f));
tags.setInteger("DrawSpeed", drawSpeed);
}
// Reset xp based on previous percentage
if (tags.hasKey("ToolEXP"))
{
//int newRequiredXp = IguanaLevelingLogic.getRequiredXp(tool, tags, false);
//long newXp = Math.round(newRequiredXp * xpPercentage);
//tags.setLong("ToolEXP", newXp);
}
// Reset head xp based on previous percentage
if (tags.hasKey("HeadEXP"))
{
//int newRequiredXp = IguanaLevelingLogic.getRequiredXp(tool, tags, true);
//long newXp = Math.round(newRequiredXp * headXpPercentage);
//tags.setLong("HeadEXP", newXp);
}
//tooltip lists
List<String> tips = new ArrayList<String>();
List<String> modifierTips = new ArrayList<String>();
if (Config.showTooltipXP)
{
int level = tags.getInteger("ToolLevel");
if (level <= 5)
{
//tips.add(IguanaLevelingTooltips.getXpString(tool, false));
modifierTips.add("");
}
if (Config.levelingPickaxeBoost)
{
int hLevel = tags.hasKey("HarvestLevel") ? hLevel = tags.getInteger("HarvestLevel") : -1;
if (hLevel >= TConstructRegistry.getMaterial("Copper").harvestLevel() && hLevel < TConstructRegistry.getMaterial("Manyullyn").harvestLevel()
&& !tags.hasKey("HarvestLevelModified")
&& (tool.getItem() instanceof Pickaxe || tool.getItem() instanceof Hammer))
{
//tips.add(IguanaLevelingTooltips.getXpString(tool, true));
modifierTips.add("");
}
}
}
//get and remove tooltips
int tipNum = 0;
while (true)
{
String tip = "Tooltip" + ++tipNum;
if (tags.hasKey(tip))
{
String tipString = tags.getString(tip);
if (!tipString.startsWith("XP:") && !tipString.startsWith("Head XP:") && !tipString.startsWith("Boost XP:"))
{
tips.add(tipString);
modifierTips.add(tags.getString("ModifierTip" + tipNum));
}
tags.removeTag(tip);
tags.removeTag("ModifierTip" + tipNum);
}
else break;
}
//write tips
for (int i = 1; i <= tips.size(); ++i)
if (tips.get(i - 1) != null)
{
tags.setString("Tooltip" + i, tips.get(i - 1));
if (modifierTips.get(i - 1) != null)
tags.setString("ModifierTip" + i, modifierTips.get(i - 1));
else
tags.setString("ModifierTip" + i, "");
}
}
void updateModTag (ItemStack tool, int[] keys)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
String tip = "ModifierTip" + keys[2];
String modName = "\u00a74Redstone (" + keys[0] + "/" + keys[1] + ")";
tags.setString(tip, modName);
}
@Override
public boolean validType (IModifyable input)
{
List<String> list = Arrays.asList(input.getTraits());
return list.contains("harvest") || list.contains("utility") || list.contains("bow");
}
}
@@ -1,124 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import iguanaman.iguanatweakstconstruct.old.IguanaConfig;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.library.tools.ToolCore;
public class IguanaModRepair extends ItemModifier {
public IguanaModRepair()
{
super(new ItemStack[0], 0, "");
}
@Override
public boolean matches (ItemStack[] input, ItemStack tool)
{
return canModify(tool, input);
}
@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
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 (matID == headID && amountToRepair(input, tool) > 0)
return true;
}
return false;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean("Broken", false);
int increase = amountToRepair(input, tool);
int damage = tags.getInteger("Damage");
int olddamage = damage;
int repair = tags.getInteger("RepairCount");
damage -= increase;
if (damage < 0)
damage = 0;
tags.setInteger("Damage", damage);
//repair += Math.round(((float)(olddamage - damage) / (float)durtotal) * 100f);
repair += olddamage - damage;
tags.setInteger("RepairCount", repair);
AbilityHelper.damageTool(tool, 0, null, true);
//tool.setItemDamage(damage * 100 / dur);
}
@Override
public void addMatchingEffect (ItemStack tool) {}
public int amountToRepair(ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
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);
//System.out.println("Increase: "+increase);
int modifiers = tags.getInteger("Modifiers");
float mods = 1.0f;
if (modifiers == 2)
mods = 0.8f;
else if (modifiers == 1)
mods = 0.6f;
else if (modifiers == 0)
mods = 0.4f;
increase *= mods;
increase /= ((ToolCore) tool.getItem()).getRepairCost();
int durtotal = tags.getInteger("TotalDurability");
int repair = tags.getInteger("RepairCount");
float repairCount = (float)repair / (float)durtotal;
if (IguanaConfig.repairLimitActive && repairCount >= IguanaConfig.repairLimit)
return 0;
increase = Math.round(increase / (IguanaConfig.repairCostPercentage / 100f));
if (IguanaConfig.repairCostScaling)
{
repairCount /= IguanaConfig.repairScalingModifier;
repairCount += 1F;
increase = Math.round(increase / repairCount);
}
return increase;
}
}
@@ -1,507 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.modifiers;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import iguanaman.iguanatweakstconstruct.leveling.LevelingLogic;
import iguanaman.iguanatweakstconstruct.leveling.LevelingTooltips;
import iguanaman.iguanatweakstconstruct.old.IguanaConfig;
import iguanaman.iguanatweakstconstruct.reference.Config;
import iguanaman.iguanatweakstconstruct.util.HarvestLevels;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.items.tools.Hammer;
import tconstruct.items.tools.Pickaxe;
import tconstruct.items.tools.Shortbow;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.crafting.ToolRecipe;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.ToolCore;
import tconstruct.library.tools.ToolMaterial;
import tconstruct.tools.BowRecipe;
import tconstruct.tools.TinkerTools;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class IguanaModUpgrade extends ItemModifier {
public IguanaModUpgrade()
{
super(new ItemStack[0], 0, "");
}
@Override
public boolean matches (ItemStack[] input, ItemStack tool)
{
if (!canModify(tool, input)) return false;
return true;
}
protected ToolRecipe GetRecipe(ToolCore tool)
{
if (tool instanceof Shortbow)
return new BowRecipe(TinkerTools.toolRod, TinkerTools.bowstring, TinkerTools.toolRod, TinkerTools.shortbow);
else
return ToolBuilder.instance.recipeList.get(tool.getToolName());
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
// basic checks
if (tool == null || tool.getItem() == null || !(tool.getItem() instanceof ToolCore)) return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.getInteger("Damage") > 0) return false;
// Get tool recipe
ToolCore toolItem = (ToolCore)tool.getItem();
ToolRecipe toolRecipe = GetRecipe(toolItem);
if (toolRecipe == null) return false;
//get old tool part materials
int oldHead = tags.getInteger("Head");
int oldHandle = tags.getInteger("Handle");
int oldAccessory = tags.getInteger("Accessory");
int oldExtra = tags.getInteger("Extra");
// check which parts are Writable
String headAbility = TConstructRegistry.getMaterial(tags.getInteger("Head")).ability;
boolean headWritable = headAbility.equals("Writable") || headAbility.equals("Thaumic") ? true : false;
String handleAbility = TConstructRegistry.getMaterial(tags.getInteger("Handle")).ability;
boolean handleWritable = handleAbility.equals("Writable") || headAbility.equals("Thaumic") ? true : false;
boolean accessoryWritable = false;
if (tags.hasKey("Accessory"))
{
String accessoryAbility = TConstructRegistry.getMaterial(tags.getInteger("Accessory")).ability;
if (accessoryAbility.equals("Writable") || accessoryAbility.equals("Thaumic")) accessoryWritable = true;
}
boolean extraWritable = false;
if (tags.hasKey("Extra"))
{
String extraAbility = TConstructRegistry.getMaterial(tags.getInteger("Extra")).ability;
if (extraAbility.equals("Writable") || extraAbility.equals("Thaumic")) extraWritable = true;
}
// check if trying to replace irreplacable parts
int modifiersNeeded = 0;
List<String> replacing = new ArrayList<String>();
for (ItemStack inputStack : input)
if (inputStack != null)
{
int partIndex = -1;
// Make sure all inputs are valid parts
if (!(toolRecipe.validHead(inputStack.getItem())
|| toolRecipe.validHandle(inputStack.getItem())
|| toolRecipe.validAccessory(inputStack.getItem())
|| toolRecipe.validExtra(inputStack.getItem()))
)
return false;
// Check for duplicates, same parts and count modifiers needed
if (toolRecipe.validHead(inputStack.getItem()))
{
if (replacing.contains("Head") || inputStack.getItemDamage() == oldHead) return false;
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newHeadWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (headWritable && !newHeadWritable) modifiersNeeded += 1;
partIndex = IguanaTweaksTConstruct.toolParts.indexOf(toolItem.getHeadItem());
replacing.add("Head");
}
else if (toolRecipe.validHandle(inputStack.getItem()))
{
if (replacing.contains("Handle") || inputStack.getItemDamage() == oldHandle) return false;
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newHandleWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (handleWritable && !newHandleWritable) modifiersNeeded += 1;
partIndex = IguanaTweaksTConstruct.toolParts.indexOf(toolItem.getHandleItem());
replacing.add("Handle");
}
else if (toolRecipe.validAccessory(inputStack.getItem()))
{
if (replacing.contains("Accessory") || inputStack.getItemDamage() == oldAccessory) return false;
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newAccessoryWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (accessoryWritable && !newAccessoryWritable) modifiersNeeded += 1;
partIndex = IguanaTweaksTConstruct.toolParts.indexOf(toolItem.getAccessoryItem());
replacing.add("Accessory");
}
else if (toolRecipe.validExtra(inputStack.getItem()))
{
if (replacing.contains("Extra") || inputStack.getItemDamage() == oldExtra) return false;
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newExtraWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (extraWritable && !newExtraWritable) modifiersNeeded += 1;
partIndex = IguanaTweaksTConstruct.toolParts.indexOf(toolItem.getExtraItem());
replacing.add("Extra");
}
// Check for stone parts
if (inputStack.getItemDamage() == 1)
if (!IguanaConfig.allowStoneTools || IguanaConfig.restrictedFlintParts.contains(partIndex+1)) return false;
}
// Check if have enough free modifiers to replace written/thaumic parts
if (tags.getInteger("Modifiers") < modifiersNeeded) return false;
return true;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
// setup variables
ToolCore toolClass = (ToolCore)tool.getItem();
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
//get old tool part materials
int oldHead = tags.getInteger("Head");
int oldHandle = tags.getInteger("Handle");
int oldAccessory = tags.getInteger("Accessory");
int oldExtra = tags.getInteger("Extra");
//get current prefix parts
ItemStack headStack = new ItemStack(toolClass.getHeadItem(), 1, oldHead);
ItemStack handleStack = new ItemStack(toolClass.getHandleItem(), 1, oldHandle);
ItemStack accessoryStack = null;
if (toolClass.getAccessoryItem() != null) accessoryStack = new ItemStack(toolClass.getAccessoryItem(), 1, oldAccessory);
ItemStack extraStack = null;
if (toolClass.getExtraItem() != null) extraStack = new ItemStack(toolClass.getExtraItem(), 1, oldExtra);
// check which parts are Writable
String headAbility = TConstructRegistry.getMaterial(tags.getInteger("Head")).ability;
boolean headWritable = headAbility.equals("Writable") || headAbility.equals("Thaumic") ? true : false;
String handleAbility = TConstructRegistry.getMaterial(tags.getInteger("Handle")).ability;
boolean handleWritable = handleAbility.equals("Writable") || headAbility.equals("Thaumic") ? true : false;
boolean accessoryWritable = false;
if (tags.hasKey("Accessory"))
{
String accessoryAbility = TConstructRegistry.getMaterial(tags.getInteger("Accessory")).ability;
if (accessoryAbility.equals("Writable") || accessoryAbility.equals("Thaumic")) accessoryWritable = true;
}
boolean extraWritable = false;
if (tags.hasKey("Extra"))
{
String extraAbility = TConstructRegistry.getMaterial(tags.getInteger("Extra")).ability;
if (extraAbility.equals("Writable") || extraAbility.equals("Thaumic")) extraWritable = true;
}
// check inputs for parts to replace
int modifiersDifference = 0;
ToolRecipe toolRecipe = GetRecipe((ToolCore)tool.getItem());
List<String> replacing = new ArrayList<String>();
for (ItemStack inputStack : input)
if (inputStack != null)
if (toolRecipe.validHead(inputStack.getItem()) && !replacing.contains("Head"))
{
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newHeadWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (headWritable && !newHeadWritable) modifiersDifference -= 1;
else if (!headWritable && newHeadWritable) modifiersDifference += 1;
headStack = inputStack;
replacing.add("Head");
}
else if (toolRecipe.validHandle(inputStack.getItem()) && !replacing.contains("Handle"))
{
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newHandleWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (handleWritable && !newHandleWritable) modifiersDifference -= 1;
else if (!handleWritable && newHandleWritable) modifiersDifference += 1;
handleStack = inputStack;
replacing.add("Handle");
}
else if (toolRecipe.validAccessory(inputStack.getItem()) && !replacing.contains("Accessory"))
{
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newAccessoryWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (accessoryWritable && !newAccessoryWritable) modifiersDifference -= 1;
else if (!accessoryWritable && newAccessoryWritable) modifiersDifference += 1;
accessoryStack = inputStack;
replacing.add("Accessory");
}
else if (toolRecipe.validExtra(inputStack.getItem()) && !replacing.contains("Extra"))
{
String ability = TConstructRegistry.getMaterial(inputStack.getItemDamage()).ability;
boolean newExtraWritable = ability.equals("Writable") || ability.equals("Thaumic") ? true : false;
if (extraWritable && !newExtraWritable) modifiersDifference -= 1;
else if (!extraWritable && newExtraWritable) modifiersDifference += 1;
extraStack = inputStack;
replacing.add("Extra");
}
//build new tool and get its tags
ItemStack newTool = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, extraStack, "");
NBTTagCompound newTags = newTool.getTagCompound().getCompoundTag("InfiTool");
//Override basic tags
int base = newTags.getInteger("BaseDurability");
int bonus = tags.getInteger("BonusDurability");
float modDur = tags.getFloat("ModDurability");
int total = Math.max((int) ((base + bonus) * (modDur + 1f)), 1);
tags.setInteger("BaseDurability", base);
tags.setInteger("TotalDurability", total);
if (tags.hasKey("ToolEXP"))
{
int requiredXp = LevelingLogic.getRequiredXp(tool, tags);
long currentXp = tags.getLong("ToolEXP");
float xpPercentage = (float)currentXp / (float)requiredXp;
int newRequiredXp = LevelingLogic.getRequiredXp(newTool, newTags);
long newXp = Math.round(newRequiredXp * xpPercentage);
tags.setLong("ToolEXP", newXp);
}
if (tags.hasKey("HeadEXP"))
{
/*
int requiredXp = IguanaLevelingLogic.getRequiredXp(tool, tags, true);
long currentXp = tags.getLong("HeadEXP");
float xpPercentage = (float)currentXp / (float)requiredXp;
int newRequiredXp = IguanaLevelingLogic.getRequiredXp(newTool, newTags, true);
long newXp = Math.round(newRequiredXp * xpPercentage);
tags.setLong("HeadEXP", newXp);
*/
}
boolean requiresBoost = false;
if (tags.hasKey("HarvestLevelModified"))
{
requiresBoost = true;
tags.removeTag("HarvestLevelModified");
if (tags.hasKey("MobHead"))
{
tags.removeTag("MobHead");
//Get and remove effects
List<Integer> badEffects = Arrays.asList(0, 20, 21, 22, 23, 24, 25);
List<Integer> effects = new ArrayList<Integer>();
for (int i = 1; i <= 6; ++i)
if (tags.hasKey("Effect" + i))
{
int effectInt = tags.getInteger("Effect" + i);
if (!badEffects.contains(effectInt)) effects.add(effectInt);
tags.removeTag("Effect" + i);
}
//Re-write effects
for (int i = 0; i < effects.size(); ++i)
tags.setInteger("Effect" + Integer.toString(i+1), effects.get(i));
}
}
if (newTags.hasKey("Shoddy")) tags.setFloat("Shoddy", newTags.getFloat("Shoddy"));
int reinforced = tags.getInteger("Unbreaking");
int reinforcedNew = newTags.getInteger("Unbreaking");
ToolMaterial oldHeadMat = TConstructRegistry.getMaterial(oldHead);
ToolMaterial oldHandleMat = TConstructRegistry.getMaterial(oldHandle);
ToolMaterial oldAccessoryMat = TConstructRegistry.getMaterial(oldAccessory);
ToolMaterial oldExtraMat = TConstructRegistry.getMaterial(oldExtra);
int reinforcedDifference = reinforcedNew - buildReinforced(oldHeadMat, oldHandleMat, oldAccessoryMat, oldExtraMat);
tags.setInteger("Unbreaking", reinforced + reinforcedDifference);
if (newTags.hasKey("FlightSpeed")) tags.setFloat("FlightSpeed", newTags.getFloat("FlightSpeed"));
List<String> replaceTags = new ArrayList<String>(Arrays.asList(
"HarvestLevel", "HarvestLevel2", "HarvestLevelHandle", "HarvestLevelExtra",
"MiningSpeed", "MiningSpeed2", "MiningSpeedHandle", "MiningSpeedExtra",
"DrawSpeed", "BaseDrawSpeed"
));
for (String replaced : replacing)
{
replaceTags.add(replaced);
replaceTags.add("Render" + replaced);
}
for (String replaceTag : replaceTags)
if (newTags.hasKey(replaceTag)) tags.setInteger(replaceTag, newTags.getInteger(replaceTag));
//Attack
if (tags.hasKey("ModAttack"))
{
int attackAmount = tags.getIntArray("ModAttack")[0];
int attackBonus = (int)(attackAmount / 30f);
tags.setInteger("Attack", newTags.getInteger("Attack") + attackBonus);
}
//Mining speed
if (tags.hasKey("Redstone"))
{
int speedAmount = tags.getIntArray("Redstone")[0];
int speedBoost = speedAmount * 8;
tags.setInteger("MiningSpeed", newTags.getInteger("MiningSpeed") + speedBoost);
if (tags.hasKey("MiningSpeed2"))
tags.setInteger("MiningSpeed2", newTags.getInteger("MiningSpeed2") + speedBoost);
if (tags.hasKey("DrawSpeed"))
{
int baseDrawSpeed = newTags.getInteger("BaseDrawSpeed");
int drawSpeed = (int) (baseDrawSpeed - 0.1f * baseDrawSpeed * (speedAmount / 50f));
tags.setInteger("DrawSpeed", drawSpeed);
}
}
//Remove unwanted modifiers
tags.setInteger("Modifiers", tags.getInteger("Modifiers") + modifiersDifference);
List<String> unwantedModifiers = Arrays.asList("Skeleton Skull", "Zombie Head", "Creeper Head", "Enderman Head", "Wither Skeleton Skull", "Nether Star");
for (String unwanted : unwantedModifiers)
if (tags.hasKey(unwanted)) tags.removeTag(unwanted);
//tooltip lists
List<String> tips = new ArrayList<String>();
List<String> modifierTips = new ArrayList<String>();
//add mining level tooltip
if (tool.getItem() instanceof Pickaxe || tool.getItem() instanceof Hammer)
{
String mLevel = HarvestLevels.getHarvestLevelName(tags.getInteger("HarvestLevel"));
tips.add("Mining Level: " + mLevel);
modifierTips.add("");
}
int level = tags.getInteger("ToolLevel");
int hLevel = tags.hasKey("HarvestLevel") ? hLevel = tags.getInteger("HarvestLevel") : -1;
tips.add(LevelingTooltips.getLevelTooltip(level));
modifierTips.add("");
if (Config.showTooltipXP)
{
/*
if (level <= 5)
{
tips.add(IguanaLevelingTooltips.getXpString(tool, false));
modifierTips.add("");
}
if (IguanaConfig.levelingPickaxeBoost)
{
if (hLevel >= TConstructRegistry.getMaterial("Copper").harvestLevel() && hLevel < TConstructRegistry.getMaterial("Manyullyn").harvestLevel()
&& !tags.hasKey("HarvestLevelModified")
&& (tool.getItem() instanceof Pickaxe || tool.getItem() instanceof Hammer))
{
tips.add(IguanaLevelingTooltips.getXpString(tool, true));
modifierTips.add("");
}
if (requiresBoost)
{
tips.add("\u00A76Requires boost");
modifierTips.add("");
}
}
*/
}
//get and remove tooltips
int tipNum = 0;
while (true)
{
String tip = "Tooltip" + ++tipNum;
if (tags.hasKey(tip))
{
String tipString = tags.getString(tip);
if (!tipString.contains("Mining Level Boost")
&& !tipString.contains("Boosted")
&& !tipString.startsWith("Mining Level:")
&& !tipString.startsWith("Skill Level:")
&& !tipString.startsWith("XP:")
&& !tipString.startsWith("Head XP:")
&& !tipString.startsWith("Boost XP:")
&& !tipString.contains("Requires boost"))
{
tips.add(tipString);
modifierTips.add(tags.getString("ModifierTip" + tipNum));
}
tags.removeTag(tip);
tags.removeTag("ModifierTip" + tipNum);
}
else break;
}
//write tips
for (int i = 1; i <= tips.size(); ++i)
if (tips.get(i - 1) != null)
{
tags.setString("Tooltip" + i, tips.get(i - 1));
if (modifierTips.get(i - 1) != null)
tags.setString("ModifierTip" + i, modifierTips.get(i - 1));
else
tags.setString("ModifierTip" + i, "");
}
String materialName = TConstructRegistry.getMaterial(oldHead).displayName;
String toolName = ((ToolCore)tool.getItem()).getToolName();
if (tool.getDisplayName().endsWith(materialName + toolName))
{
materialName = TConstructRegistry.getMaterial(tags.getInteger("Head")).displayName;
// TODO: find replacement for setItemName
//tool.setItemName("\u00a7r" + materialName + toolName);
}
}
@Override
public void addMatchingEffect (ItemStack tool) {}
int buildReinforced (ToolMaterial headMat, ToolMaterial handleMat, ToolMaterial accessoryMat, ToolMaterial extraMat)
{
int reinforced = 0;
int dHead = headMat.reinforced();
int dHandle = handleMat.reinforced();
int dAccessory = 0;
if (accessoryMat != null)
dAccessory = accessoryMat.reinforced();
int dExtra = 0;
if (extraMat != null)
dExtra = extraMat.reinforced();
if (dHead > reinforced)
reinforced = dHead;
if (dHandle > reinforced)
reinforced = dHandle;
if (dAccessory > reinforced)
reinforced = dAccessory;
if (dExtra > reinforced)
reinforced = dExtra;
return reinforced;
}
}
@@ -1,39 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.proxy;
import cpw.mods.fml.client.registry.ClientRegistry;
import iguanaman.iguanatweakstconstruct.old.IguanaClientEventHandler;
import iguanaman.iguanatweakstconstruct.old.blocks.IguanaTileEntitySkull;
import iguanaman.iguanatweakstconstruct.old.renderer.IguanaSkullRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenderers() {
ClientRegistry.bindTileEntitySpecialRenderer(IguanaTileEntitySkull.class, new IguanaSkullRenderer());
}
@Override
public void registerSounds() {
MinecraftForge.EVENT_BUS.register(new IguanaClientEventHandler());
}
@Override
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z) {
/*
if (ID == ToolProxyCommon.toolStationID)
return new IguanaToolStationGui(player.inventory, (ToolStationLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == ToolProxyCommon.partBuilderID)
return new IguanaPartCrafterGui(player.inventory, (PartBuilderLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == ToolProxyCommon.patternChestID)
return new PatternChestGui(player.inventory, (PatternChestLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == ToolProxyCommon.toolForgeID)
return new IguanaToolForgeGui(player.inventory, (ToolForgeLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == ToolProxyCommon.stencilTableID)
return new StencilTableGui(player.inventory, (StencilTableLogic) world.getTileEntity(x, y, z), world, x, y, z);
*/
return null;
}
}
@@ -1,36 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.proxy;
import cpw.mods.fml.common.network.IGuiHandler;
import mantle.blocks.abstracts.InventoryLogic;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import tconstruct.tools.ToolProxyCommon;
public class CommonProxy implements IGuiHandler
{
public void registerRenderers() {}
public void registerSounds() {}
@Override
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
{
if (ID == ToolProxyCommon.toolStationID || ID == ToolProxyCommon.partBuilderID || ID == ToolProxyCommon.patternChestID
|| ID == ToolProxyCommon.toolForgeID || ID == ToolProxyCommon.stencilTableID)
{
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof InventoryLogic)
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player,
World world, int x, int y, int z) {
return null;
}
}
@@ -1,112 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.renderer;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelSkeletonHead;
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import java.util.Map;
public class IguanaSkullRenderer extends TileEntitySkullRenderer {
private static final ResourceLocation field_147537_c = new ResourceLocation("textures/entity/skeleton/skeleton.png");
private static final ResourceLocation field_147534_d = new ResourceLocation("textures/entity/skeleton/wither_skeleton.png");
private static final ResourceLocation field_147535_e = new ResourceLocation("textures/entity/zombie/zombie.png");
private static final ResourceLocation field_147532_f = new ResourceLocation("textures/entity/creeper/creeper.png");
private ModelSkeletonHead field_147533_g = new ModelSkeletonHead(0, 0, 64, 32);
private ModelSkeletonHead field_147538_h = new ModelSkeletonHead(0, 0, 64, 64);
public IguanaSkullRenderer() {}
@Override
public void func_152674_a(float p_152674_1_, float p_152674_2_, float p_152674_3_, int p_152674_4_, float p_152674_5_, int p_152674_6_, GameProfile p_152674_7_)
{
ModelSkeletonHead modelskeletonhead = field_147533_g;
switch (p_152674_6_)
{
case 0:
default:
bindTexture(field_147537_c);
break;
case 1:
bindTexture(field_147534_d);
break;
case 2:
bindTexture(field_147535_e);
modelskeletonhead = field_147538_h;
break;
case 3:
ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng;
if (p_152674_7_ != null)
{
Minecraft minecraft = Minecraft.getMinecraft();
Map map = minecraft.func_152342_ad().func_152788_a(p_152674_7_);
if (map.containsKey(Type.SKIN))
{
resourcelocation = minecraft.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN);
}
}
bindTexture(resourcelocation);
break;
case 4:
bindTexture(field_147532_f);
break;
case 5:
bindTexture(new ResourceLocation("textures/entity/enderman/enderman.png"));
break;
case 6:
bindTexture(new ResourceLocation("textures/entity/zombie_pigman.png"));
break;
case 7:
bindTexture(new ResourceLocation("textures/entity/blaze.png"));
break;
}
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
if (p_152674_4_ != 1)
{
switch (p_152674_4_)
{
case 2:
GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_ + 0.25F, p_152674_3_ + 0.74F);
break;
case 3:
GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_ + 0.25F, p_152674_3_ + 0.26F);
p_152674_5_ = 180.0F;
break;
case 4:
GL11.glTranslatef(p_152674_1_ + 0.74F, p_152674_2_ + 0.25F, p_152674_3_ + 0.5F);
p_152674_5_ = 270.0F;
break;
case 5:
default:
GL11.glTranslatef(p_152674_1_ + 0.26F, p_152674_2_ + 0.25F, p_152674_3_ + 0.5F);
p_152674_5_ = 90.0F;
}
}
else
{
GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_, p_152674_3_ + 0.5F);
}
float f4 = 0.0625F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(-1.0F, -1.0F, 1.0F);
GL11.glEnable(GL11.GL_ALPHA_TEST);
modelskeletonhead.render((Entity)null, 0.0F, 0.0F, 0.0F, p_152674_5_, 0.0F, f4);
GL11.glPopMatrix();
}
}
@@ -1,253 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.tweaks;
import iguanaman.iguanatweakstconstruct.old.IguanaConfig;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.oredict.OreDictionary;
import tconstruct.library.TConstructRegistry;
import tconstruct.world.TinkerWorld;
import java.lang.reflect.Field;
import java.util.*;
public class HarvestLevelTweaks {
public static int boostMod = 0;
// HarvestLevels
public static String[][] oreDictLevels = {
{},
{"Copper", "Coal", "Tetrahedrite", "Aluminum", "Aluminium", "NaturalAluminum", "AluminumBrass", "Shard", "Bauxite", "Zinc"},
{"Iron", "Pyrite", "Lead", "Silver"},
{"Tin", "Cassiterite", "Gold", "Lapis", "Steel", "Galena", "Nickel", "Invar", "Electrum", "Sphalerite"},
{"Diamond", "Emerald", "Redstone", "Ruby", "Sapphire", "Cinnabar", "Quartz",
"Obsidian", "CertusQuartz", "Tungstate", "Sodalite", "GreenSapphire", "BlackGranite", "RedGranite"},
{"Ardite", "Uranium", "Olivine", "Sheldonite", "Osmium", "Platinum"},
{"Cobalt", "Iridium", "Cooperite", "Titanium"},
{"Manyullyn"}
};
public static void init()
{
// TOOLS
Log.info("Modifying harvest levels of tools");
ForgeHooks hooks = new ForgeHooks();
Field f = null;
try {
f = ForgeHooks.class.getDeclaredField("toolClasses");
} catch (NoSuchFieldException e) {
throw new RuntimeException("Could not access toolClasses field, report please");
}
f.setAccessible(true);
HashMap<Item, List> toolClasses = null;
try {
toolClasses = (HashMap<Item, List>) f.get(hooks);
} catch (IllegalAccessException e) {
throw new RuntimeException("Could not access toolClasses field, report please");
}
int harvestLevelWood = TConstructRegistry.getMaterial("Wood").harvestLevel();
int harvestLevelFlint = TConstructRegistry.getMaterial("Flint").harvestLevel();
int harvestLevelIron = TConstructRegistry.getMaterial("Iron").harvestLevel();
int harvestLevelObsidian = TConstructRegistry.getMaterial("Obsidian").harvestLevel();
int harvestLevelArdite = TConstructRegistry.getMaterial("Ardite").harvestLevel();
int harvestLevelCobalt = TConstructRegistry.getMaterial("Cobalt").harvestLevel();
int harvestLevelManyullyn = TConstructRegistry.getMaterial("Manyullyn").harvestLevel();
Iterator<Map.Entry<Item, List>> it = toolClasses.entrySet().iterator();
while (it.hasNext())
{
Map.Entry<Item, List> entry = it.next();
Item item = entry.getKey();
List info = entry.getValue();
Object[] tmp = info.toArray();
String toolClass = (String)tmp[0];
int harvestLevel = (Integer)tmp[1];
int newHarvestLevel = harvestLevel;
if (item != null && toolClass.equals("pickaxe"))
{
// TODO: Find a better way to implement pickaxe overrides
/*
if (IguanaIguanaConfig.pickaxeOverrides.containsKey(prefix.getUnlocalizedName()))
harvestLevel = IguanaIguanaConfig.pickaxeOverrides.get(prefix.itemID);*/
switch (harvestLevel)
{
case 0: newHarvestLevel = harvestLevelWood; break;
case 1: newHarvestLevel = harvestLevelFlint; break;
case 2: newHarvestLevel = harvestLevelIron; break;
case 3: newHarvestLevel = harvestLevelObsidian; break;
case 4: newHarvestLevel = harvestLevelArdite; break;
case 5: newHarvestLevel = harvestLevelCobalt; break;
case 6: newHarvestLevel = harvestLevelManyullyn; break;
default: newHarvestLevel = harvestLevelManyullyn + harvestLevel - 6;
}
if (harvestLevel != newHarvestLevel)
{
if (IguanaConfig.logMiningLevelChanges) Log.info("Changing mining level of " + entry.getKey().getUnlocalizedName() + " from " + harvestLevel + " to " + newHarvestLevel);
entry.setValue(Arrays.asList(toolClass, newHarvestLevel));
}
}
}
//BLOCKS
if (IguanaConfig.pickaxeBoostRequired) boostMod = 1;
int harvestLevelCopper = TConstructRegistry.getMaterial("Copper").harvestLevel() + boostMod;
harvestLevelIron += boostMod;
int harvestLevelBronze = TConstructRegistry.getMaterial("Bronze").harvestLevel() + boostMod;
harvestLevelObsidian += boostMod;
harvestLevelArdite += boostMod;
harvestLevelCobalt += boostMod;
harvestLevelManyullyn += boostMod;
Log.info("Modifying required harvest levels of blocks");
try {
f = ForgeHooks.class.getDeclaredField("toolHarvestLevels");
} catch (NoSuchFieldException e) {
throw new RuntimeException("Could not access toolHarvestLevels field, report please");
}
f.setAccessible(true);
HashMap<List, Integer> toolHarvestLevels = null;
try {
toolHarvestLevels = (HashMap<List, Integer>) f.get(hooks);
} catch (IllegalAccessException e) {
throw new RuntimeException("Could not access toolHarvestLevels field, report please");
}
Iterator<Map.Entry<List, Integer>> it2 = toolHarvestLevels.entrySet().iterator();
while (it2.hasNext())
{
Map.Entry<List, Integer> entry = it2.next();
List key = entry.getKey();
Object[] tmp = key.toArray();
Block block = (Block)tmp[0];
int metadata = (Integer)tmp[1];
String toolClass = (String)tmp[2];
if (toolClass.equals("pickaxe"))
{
int requiredHarvestLevel = entry.getValue();
int newRequiredHarvestLevel = requiredHarvestLevel;
switch (requiredHarvestLevel)
{
case 0: newRequiredHarvestLevel = harvestLevelWood; break;
case 1: newRequiredHarvestLevel = harvestLevelCopper; break;
case 2: newRequiredHarvestLevel = harvestLevelIron; break;
case 3: newRequiredHarvestLevel = harvestLevelBronze; break;
case 4: newRequiredHarvestLevel = harvestLevelObsidian; break;
case 5: newRequiredHarvestLevel = harvestLevelArdite; break;
case 6: newRequiredHarvestLevel = harvestLevelCobalt; break;
case 7: newRequiredHarvestLevel = harvestLevelManyullyn; break;
default: newRequiredHarvestLevel = harvestLevelManyullyn + requiredHarvestLevel - 7;
}
if (requiredHarvestLevel != newRequiredHarvestLevel)
{
if (IguanaConfig.logHarvestLevelChanges) Log.info("Changing required harvest level of " + block.getUnlocalizedName() + ":" + metadata + " from " + requiredHarvestLevel + " to " + newRequiredHarvestLevel);
entry.setValue(newRequiredHarvestLevel);
}
}
}
for (int i = 0; i < oreDictLevels.length; ++i)
{
int level = i;
if (i > 1) level += boostMod;
for (String materialName : oreDictLevels[i]) {
for (ItemStack oreStack : OreDictionary.getOres("ore" + materialName)) SetHarvestLevel(oreStack, level);
for (ItemStack oreStack : OreDictionary.getOres("oreNether" + materialName)) SetHarvestLevel(oreStack, level);
for (ItemStack oreStack : OreDictionary.getOres("prefix" + materialName)) SetHarvestLevel(oreStack, level);
for (ItemStack oreStack : OreDictionary.getOres("stone" + materialName)) SetHarvestLevel(oreStack, level);
}
}
Log.info("Modifying required harvest levels of vanilla blocks");
Blocks.obsidian.setHarvestLevel("pickaxe", harvestLevelBronze);
Blocks.diamond_ore.setHarvestLevel("pickaxe", harvestLevelBronze);
Blocks.diamond_block.setHarvestLevel("pickaxe", harvestLevelBronze);
Blocks.gold_block.setHarvestLevel("pickaxe", harvestLevelIron);
Blocks.iron_block.setHarvestLevel("pickaxe", harvestLevelCopper);
Blocks.iron_bars.setHarvestLevel("pickaxe", harvestLevelCopper);
Blocks.lapis_block.setHarvestLevel("pickaxe", harvestLevelIron);
Blocks.redstone_ore.setHarvestLevel("pickaxe", harvestLevelBronze);
Blocks.lit_redstone_ore.setHarvestLevel("pickaxe", harvestLevelBronze);
TinkerWorld.oreGravel.setHarvestLevel("shovel", harvestLevelIron, 0);
TinkerWorld.oreGravel.setHarvestLevel("shovel", harvestLevelIron, 1);
TinkerWorld.oreGravel.setHarvestLevel("shovel", harvestLevelFlint, 2);
TinkerWorld.oreGravel.setHarvestLevel("shovel", harvestLevelIron, 3);
TinkerWorld.oreGravel.setHarvestLevel("shovel", harvestLevelFlint, 4);
TinkerWorld.oreGravel.setHarvestLevel("shovel", harvestLevelArdite, 5);
List[] harvestLevelIds = {
IguanaConfig.harvestLevel0Ids, IguanaConfig.harvestLevel1Ids, IguanaConfig.harvestLevel2Ids,
IguanaConfig.harvestLevel3Ids, IguanaConfig.harvestLevel4Ids, IguanaConfig.harvestLevel5Ids,
IguanaConfig.harvestLevel6Ids, IguanaConfig.harvestLevel7Ids
};
for (int i = 0; i < oreDictLevels.length; ++i)
{
int level = i;
if (i > 1) level += boostMod;
for (String idline : (List<String>)harvestLevelIds[i])
{
int blockId = -1;
int meta = OreDictionary.WILDCARD_VALUE;
try {
if (idline.contains(":"))
{
String[] idlinesplit = idline.split(":");
blockId = Integer.parseInt(idlinesplit[0]);
meta = Integer.parseInt(idlinesplit[1]);
} else
blockId = Integer.parseInt(idline);
} catch (Exception e) {
throw new RuntimeException("IguanaConfig setting harvestLevel" + i + "Ids contains an invalid line (" + idline + "). Each id must be on a separate line and in this format: id or id:meta");
}
// TODO: find a way to implement prefix harvest override
//SetHarvestLevel(new ItemStack(blockId, 1, meta), level);
}
}
}
public static void SetHarvestLevel(ItemStack oreStack, int level)
{
Block block = Block.getBlockFromItem(oreStack.getItem());
if (block == Blocks.air)
{
Log.warn("Warning: " + oreStack.getUnlocalizedName() + " is invalid prefix");
return;
}
if (oreStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
block.setHarvestLevel("pickaxe", level);
//FMLLog.warning("IguanaTweaksTConstruct: Setting required harvest level of " + oreStack.getUnlocalizedName() + " to " + level);
else
block.setHarvestLevel("pickaxe", level, oreStack.getItemDamage());
//FMLLog.warning("IguanaTweaksTConstruct: Setting required harvest level of " + oreStack.getUnlocalizedName() + ":" + oreStack.getItemDamage() + " to " + level);
}
}
@@ -1,199 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.tweaks;
import cpw.mods.fml.common.Loader;
import iguanaman.iguanatweakstconstruct.reference.Config;
import iguanaman.iguanatweakstconstruct.util.Log;
import tconstruct.library.TConstructRegistry;
import tconstruct.tools.TinkerTools;
public class MaterialTweaks {
public static void init()
{
// TINKERS
Log.info("Modifying TConstruct materials");
float durMod = Config.durabilityPercentage / 100F;
float speedMod = Config.miningSpeedPercentage / 100F;
TConstructRegistry.toolMaterials.remove(0);
TConstructRegistry.addToolMaterial(0, "Wood", "Wooden ", 0, Math.round(59F * durMod), Math.round(150f * speedMod), 1, 1.0F, 0, 0f, "\u00A7e", "");
TConstructRegistry.toolMaterials.remove(4);
TConstructRegistry.addToolMaterial(4, "Cactus", 0, Math.round(150F * durMod), Math.round(500f * speedMod), 2, 1.0F, 0, -1f, "\u00A72", "Jagged");
TConstructRegistry.toolMaterials.remove(8);
TConstructRegistry.addToolMaterial(8, "Slime", 0, Math.round(500f * durMod), Math.round(100f * speedMod), 1, 2.0F, 0, 0f, "\u00A7a", "");
TConstructRegistry.toolMaterials.remove(17);
TConstructRegistry.addToolMaterial(17, "BlueSlime", "Slime ", 0, Math.round(1200f * durMod), Math.round(100f * speedMod), 1, 1.5F, 0, 0f, "\u00A7b", "");
TConstructRegistry.toolMaterials.remove(9);
TConstructRegistry.addToolMaterial(9, "Paper", 0, Math.round(30F * durMod), Math.round(100f * speedMod), 1, 0.3F, 0, 0f, "\u00A7f", "Writable");
TConstructRegistry.toolMaterials.remove(1);
TConstructRegistry.addToolMaterial(1, "Stone", 0, Math.round(131F * durMod), Math.round(300f * speedMod), 2, 0.5F, 0, 1f, "", "Stonebound");
TConstructRegistry.toolMaterials.remove(3);
TConstructRegistry.addToolMaterial(3, "Flint", 1, Math.round(171F * durMod), Math.round(400f * speedMod), 2, 0.5F, 0, 0f, "\u00A78", "");
TConstructRegistry.toolMaterials.remove(5);
TConstructRegistry.addToolMaterial(5, "Bone", 1, Math.round(200f * durMod), Math.round(400f * speedMod), 2, 1.0F, 0, 0f, "\u00A7e", "");
TConstructRegistry.toolMaterials.remove(7);
TConstructRegistry.addToolMaterial(7, "Netherrack", 0, Math.round(131f * durMod), Math.round(400f * speedMod), 3, 1.2F, 0, 1f, "\u00A74", "Stonebound");
TConstructRegistry.toolMaterials.remove(13);
TConstructRegistry.addToolMaterial(13, "Copper", 2, Math.round(180f * durMod), Math.round(500f * speedMod), 2, 1.15F, 0, 0f, "\u00A7c", "");
TConstructRegistry.toolMaterials.remove(2);
TConstructRegistry.addToolMaterial(2, "Iron", 3, Math.round(250f * durMod), Math.round(600f * speedMod), 3, 1.3F, 1, 0f, "\u00A7f", "");
TConstructRegistry.toolMaterials.remove(14);
TConstructRegistry.addToolMaterial(14, "Bronze", 4, Math.round(350f * durMod), Math.round(700f * speedMod), 3, 1.3F, 1, 0f, "\u00A76", "");
if (TinkerTools.thaumcraftAvailable)
{
TConstructRegistry.toolMaterials.remove(31);
TConstructRegistry.addToolMaterial(31, "Thaumium", 3, Math.round(200f * durMod), Math.round(600f * speedMod), 3, 1.3F, 0, 0f, "\u00A75", "Thaumic");
}
TConstructRegistry.toolMaterials.remove(16);
TConstructRegistry.addToolMaterial(16, "Steel", 4, Math.round(400f * durMod), Math.round(800f * speedMod), 3, 1.3F, 2, 0f, "\u00A7f", "");
TConstructRegistry.toolMaterials.remove(18);
TConstructRegistry.addToolMaterial(18, "PigIron", "Pig Iron ", 4, Math.round(250F * durMod), Math.round(600F * speedMod), 3, 1.3F, 1, 0f, "\u00A7c", "Tasty");
TConstructRegistry.toolMaterials.remove(6);
TConstructRegistry.addToolMaterial(6, "Obsidian", 5, Math.round(89f * durMod), Math.round(700f * speedMod), 3, 0.8F, 3, 0f, "\u00A78", "");
TConstructRegistry.toolMaterials.remove(15);
TConstructRegistry.addToolMaterial(15, "Alumite", 5, Math.round(550f * durMod), Math.round(800f * speedMod), 4, 1.3F, 2, 0f, "\u00A7d", "");
TConstructRegistry.toolMaterials.remove(11);
TConstructRegistry.addToolMaterial(11, "Ardite", 6, Math.round(600f * durMod), Math.round(800f * speedMod), 4, 2.0F, 0, 2f, "\u00A74", "Stonebound");
TConstructRegistry.toolMaterials.remove(10);
TConstructRegistry.addToolMaterial(10, "Cobalt", 7, Math.round(800f * durMod), Math.round(1100f * speedMod), 4, 1.75F, 2, 0f, "\u00A73", "");
TConstructRegistry.toolMaterials.remove(12);
TConstructRegistry.addToolMaterial(12, "Manyullyn", 8, Math.round(1200f * durMod), Math.round(900f * speedMod), 5, 2.5F, 0, 0f, "\u00A75", "");
//Extra TiC / Metallurgy materials
if (Loader.isModLoaded("ExtraTiC") && Loader.isModLoaded("Metallurgy3Base"))
{
// Stone level
TConstructRegistry.toolMaterials.remove(103);
TConstructRegistry.addToolMaterial(103, "Brass", 0, Math.round(15F * durMod), Math.round(1200F * speedMod), 2, 0.2F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(104);
TConstructRegistry.addToolMaterial(104, "Electrum", 0, Math.round(100F * durMod), Math.round(2000F * speedMod), 2, 0.75F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(106);
TConstructRegistry.addToolMaterial(106, "Silver", 0, Math.round(25F * durMod), Math.round(1600F * speedMod), 2, 0.2F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(109);
TConstructRegistry.addToolMaterial(109, "Ignatius", 0, Math.round(200F * durMod), Math.round(400F * speedMod), 3, 1.0F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(114);
TConstructRegistry.addToolMaterial(114, "Shadow Iron", 0, Math.round(300F * durMod), Math.round(400F * speedMod), 3, 1.3F, 1, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(129);
TConstructRegistry.addToolMaterial(129, "Prometheum", 0, Math.round(200F * durMod), Math.round(400F * speedMod), 2, 1.0F, 0, 0.0F, "", "");
// Iron Level
TConstructRegistry.toolMaterials.remove(105);
TConstructRegistry.addToolMaterial(105, "Platinum", 3, Math.round(100F * durMod), Math.round(2400F * speedMod), 2, 0.75F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(115);
TConstructRegistry.addToolMaterial(115, "Shadow Steel", 3, Math.round(400F * durMod), Math.round(600F * speedMod), 4, 1.3F, 2, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(121);
TConstructRegistry.addToolMaterial(121, "Black Steel", 3, Math.round(500F * durMod), Math.round(800F * speedMod), 3, 1.3F, 2, 0.0F, "§9", "");
TConstructRegistry.toolMaterials.remove(124);
TConstructRegistry.addToolMaterial(124, "Deep Iron", 3, Math.round(250F * durMod), Math.round(600F * speedMod), 3, 1.3F, 1, 0.0F, "§9", "");
// Bronze Level
TConstructRegistry.toolMaterials.remove(100);
TConstructRegistry.addToolMaterial(100, "Angmallen", 4, Math.round(300F * durMod), Math.round(800F * speedMod), 3, 1.0F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(102);
TConstructRegistry.addToolMaterial(102, "Hepatizon", 4, Math.round(300F * durMod), Math.round(800F * speedMod), 2, 1.2F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(108);
TConstructRegistry.addToolMaterial(108, "Ceruclase", 4, Math.round(500F * durMod), Math.round(700F * speedMod), 4, 1.4F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(112);
TConstructRegistry.addToolMaterial(112, "Midasium", 4, Math.round(100F * durMod), Math.round(1000F * speedMod), 4, 1.0F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(117);
TConstructRegistry.addToolMaterial(117, "Vyroxeres", 4, Math.round(300F * durMod), Math.round(700F * speedMod), 4, 1.3F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(128);
TConstructRegistry.addToolMaterial(128, "Oureclase", 4, Math.round(750F * durMod), Math.round(800F * speedMod), 3, 1.3F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(133);
TConstructRegistry.addToolMaterial(133, "Eximite", 4, Math.round(1000F * durMod), Math.round(800F * speedMod), 4, 1.3F, 0, 0.0F, "", "");
// Obsidian Level
TConstructRegistry.toolMaterials.remove(101);
TConstructRegistry.addToolMaterial(101, "Damascus Steel", 5, Math.round(500F * durMod), Math.round(600F * speedMod), 3, 1.3F, 2, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(107);
TConstructRegistry.addToolMaterial(107, "Amordrine", 5, Math.round(1300F * durMod), Math.round(1400F * speedMod), 4, 1.8F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(110);
TConstructRegistry.addToolMaterial(110, "Inolashite", 5, Math.round(900F * durMod), Math.round(800F * speedMod), 4, 1.7F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(111);
TConstructRegistry.addToolMaterial(111, "Kalendrite", 5, Math.round(1000F * durMod), Math.round(800F * speedMod), 4, 1.75F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(119);
TConstructRegistry.addToolMaterial(119, "Astral Silver", 5, Math.round(35F * durMod), Math.round(1200F * speedMod), 2, 0.35F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(122);
TConstructRegistry.addToolMaterial(122, "Carmot", 5, Math.round(50F * durMod), Math.round(1200F * speedMod), 2, 0.35F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(125);
TConstructRegistry.addToolMaterial(125, "Haderoth", 5, Math.round(1250F * durMod), Math.round(1200F * speedMod), 4, 2.3F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(126);
TConstructRegistry.addToolMaterial(126, "Mithril", 5, Math.round(1000F * durMod), Math.round(900F * speedMod), 4, 1.5F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(130);
TConstructRegistry.addToolMaterial(130, "Quicksilver", 5, Math.round(1100F * durMod), Math.round(1400F * speedMod), 4, 1.8F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(132);
TConstructRegistry.addToolMaterial(132, "Desichalkosr", 5, Math.round(1800F * durMod), Math.round(1000F * speedMod), 5, 2.75F, 0, 0.0F, "", "");
//Ardite Level
TConstructRegistry.toolMaterials.remove(116);
TConstructRegistry.addToolMaterial(116, "Vulcanite", 6, Math.round(1500F * durMod), Math.round(1000F * speedMod), 4, 2.0F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(123);
TConstructRegistry.addToolMaterial(123, "Celenegil", 6, Math.round(1600F * durMod), Math.round(1400F * speedMod), 4, 2.5F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(127);
TConstructRegistry.addToolMaterial(127, "Orichalcum", 6, Math.round(1350F * durMod), Math.round(900F * speedMod), 4, 2.5F, 0, 0.0F, "", "");
// Cobalt Level
TConstructRegistry.toolMaterials.remove(113);
TConstructRegistry.addToolMaterial(113, "Sanguinite", 7, Math.round(1750F * durMod), Math.round(1200F * speedMod), 5, 2.3F, 0, 0.0F, "", "");
TConstructRegistry.toolMaterials.remove(118);
TConstructRegistry.addToolMaterial(118, "Adamantine", 7, Math.round(1550F * durMod), Math.round(1000F * speedMod), 5, 2.75F, 2, 0.0F, "§4", "");
TConstructRegistry.toolMaterials.remove(120);
TConstructRegistry.addToolMaterial(120, "Atlarus", 7, Math.round(1750F * durMod), Math.round(1000F * speedMod), 5, 2.5F, 0, 0.0F, "", "");
//Manyullyn Level
TConstructRegistry.toolMaterials.remove(131);
TConstructRegistry.addToolMaterial(131, "Tartarite", 8, Math.round(3000F * durMod), Math.round(1400F * speedMod), 6, 3.0F, 0, 0.0F, "", "");
}
}
}
@@ -1,128 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.tweaks;
import cpw.mods.fml.common.registry.GameRegistry;
import iguanaman.iguanatweakstconstruct.old.IguanaConfig;
import iguanaman.iguanatweakstconstruct.old.modifiers.*;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.client.TConstructClientRegistry;
import tconstruct.library.crafting.ModifyBuilder;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.ToolCore;
import tconstruct.modifiers.tools.ModDurability;
import tconstruct.modifiers.tools.ModInteger;
import tconstruct.tools.TinkerTools;
import java.util.Iterator;
public class ModifierTweaks
{
public static void init ()
{
// REMOVE OLD MODIFIERS
Log.info("Removing old modifiers");
Iterator<ItemModifier> i = ModifyBuilder.instance.itemModifiers.iterator();
while (i.hasNext())
{
ItemModifier mod = i.next();
if (mod.key == "Emerald" || mod.key == "Diamond" || mod.key == "Tier1Free" && IguanaConfig.toolLeveling || mod.key == "Tier2Free" || mod.key == "Moss" || mod.key == "Lapis"
|| mod.key == "ModAttack" || mod.key == "Redstone" || mod.key == "")
//IguanaLog.log("Removing old " + mod.key + " modifier");
i.remove();
}
// Change recipes
if (IguanaConfig.moreExpensiveSilkyCloth)
{
RecipeRemover.removeAnyRecipe(new ItemStack(TinkerTools.materials, 1, 25));
GameRegistry.addRecipe(new ItemStack(TinkerTools.materials, 1, 25), "sss", "sns", "sss", 'n', new ItemStack(TinkerTools.materials, 1, 14), 's', new ItemStack(Items.string)); //Silky Cloth
GameRegistry.addRecipe(new ItemStack(TinkerTools.materials, 1, 25), "sss", "sns", "sss", 'n', new ItemStack(Items.gold_ingot), 's', new ItemStack(Items.string)); //Silky Cloth
}
if (IguanaConfig.moreExpensiveSilkyJewel)
{
RecipeRemover.removeAnyRecipe(new ItemStack(TinkerTools.materials, 1, 26));
GameRegistry.addRecipe(new ItemStack(TinkerTools.materials, 1, 26), " c ", "cec", " c ", 'c', new ItemStack(TinkerTools.materials, 1, 25), 'e', new ItemStack(Blocks.emerald_block)); //Silky Jewel
}
// REPLACE OLD MODIFIERS
Log.info("Replacing old modifiers");
if (IguanaConfig.partReplacement)
ModifyBuilder.registerModifier(new IguanaModUpgrade());
ModifyBuilder.registerModifier(new IguanaModRepair());
// TODO: Find a way to replace vanilla skullItem
/*if (!IguanaIguanaConfig.toolLevelingRandomBonuses)
ModifyBuilder.registerModifier(new ModExtraModifier(new ItemStack[] { new ItemStack(Items.sk, 1, 6), new ItemStack(Item.skullItem, 1, 7) }, "Tier2Free"));*/
ModifyBuilder.registerModifier(new ModInteger(new ItemStack[] { new ItemStack(TinkerTools.materials, 1, 6) }, 4, "Moss", IguanaConfig.mossRepairSpeed, "\u00a72", "Auto-Repair"));
ModifyBuilder.registerModifier(new ModDurability(new ItemStack[] { new ItemStack(Items.emerald) }, 1, 0, 0.5f, TConstructRegistry.getMaterial("Bronze").harvestLevel(), "Emerald",
"\u00a72Durability +50%", "\u00a72"));
ModifyBuilder.registerModifier(new ModDurability(new ItemStack[] { new ItemStack(Items.diamond) }, 0, 500, 0f, 0, "Diamond", "\u00a7bDurability +500", "\u00a7b"));
ItemStack lapisItem = new ItemStack(Items.dye, 1, 4);
ItemStack lapisBlock = new ItemStack(Blocks.lapis_block);
ModifyBuilder.registerModifier(new IguanaModLapis(new ItemStack[] { lapisBlock, lapisItem }, 10, new int[] { 9, 1 }));
ItemStack quartzItem = new ItemStack(Items.quartz);
ItemStack quartzBlock = new ItemStack(Blocks.quartz_block, 1, Short.MAX_VALUE);
ModifyBuilder.registerModifier(new IguanaModAttack("Quartz", new ItemStack[] { quartzItem }, 11, 1));
ModifyBuilder.registerModifier(new IguanaModAttack("Quartz", new ItemStack[] { quartzItem, quartzItem }, 11, 2));
ModifyBuilder.registerModifier(new IguanaModAttack("Quartz", new ItemStack[] { quartzBlock }, 11, 4));
ModifyBuilder.registerModifier(new IguanaModAttack("Quartz", new ItemStack[] { quartzItem, quartzBlock }, 11, 5));
ModifyBuilder.registerModifier(new IguanaModAttack("Quartz", new ItemStack[] { quartzBlock, quartzBlock }, 11, 8));
ItemStack redstoneItem = new ItemStack(Items.redstone);
ItemStack redstoneBlock = new ItemStack(Blocks.redstone_block);
ModifyBuilder.registerModifier(new IguanaModRedstone(new ItemStack[] { redstoneItem }, 2, 1));
ModifyBuilder.registerModifier(new IguanaModRedstone(new ItemStack[] { redstoneItem, redstoneItem }, 2, 2));
ModifyBuilder.registerModifier(new IguanaModRedstone(new ItemStack[] { redstoneBlock }, 2, 9));
ModifyBuilder.registerModifier(new IguanaModRedstone(new ItemStack[] { redstoneItem, redstoneBlock }, 2, 10));
ModifyBuilder.registerModifier(new IguanaModRedstone(new ItemStack[] { redstoneBlock, redstoneBlock }, 2, 18));
// CLEAN MODIFIER
if (IguanaConfig.addCleanModifier)
ModifyBuilder.registerModifier(new IguanaModClean());
// MINING BOOST MODIFIERS
if (IguanaConfig.mobHeadPickaxeBoost)
{
Log.info("Adding mob head modifiers");
// add modifers
ModifyBuilder.registerModifier(new IguanaModHeads(new ItemStack[] { new ItemStack(Items.skull, 1, 0) }, 20, TConstructRegistry.getMaterial("Iron").harvestLevel(), "Skeleton Skull",
"\u00a7fBoosted", "\u00a7f"));
ModifyBuilder.registerModifier(new IguanaModHeads(new ItemStack[] { new ItemStack(Items.skull, 1, 2) }, 21, TConstructRegistry.getMaterial("Iron").harvestLevel(), "Zombie Head",
"\u00a72Boosted", "\u00a72"));
ModifyBuilder.registerModifier(new IguanaModHeads(new ItemStack[] { new ItemStack(Items.skull, 1, 4) }, 22, TConstructRegistry.getMaterial("Bronze").harvestLevel(), "Creeper Head",
"\u00a7aBoosted", "\u00a7a"));
ModifyBuilder.registerModifier(new IguanaModHeads(new ItemStack[] { new ItemStack(Items.skull, 1, 5) }, 23, TConstructRegistry.getMaterial("Obsidian").harvestLevel(), "Enderman Head",
"\u00a78Boosted", "\u00a78"));
ModifyBuilder.registerModifier(new IguanaModHeads(new ItemStack[] { new ItemStack(Items.skull, 1, 1) }, 24, TConstructRegistry.getMaterial("Ardite").harvestLevel(), "Wither Skeleton Skull",
"\u00a78Boosted", "\u00a78"));
ModifyBuilder.registerModifier(new IguanaModHeads(new ItemStack[] { new ItemStack(Items.nether_star) }, 25, TConstructRegistry.getMaterial("Cobalt").harvestLevel(), "Nether Star",
"\u00a73Boosted", "\u00a73"));
// rendering code
ToolCore[] tools = new ToolCore[] { TinkerTools.pickaxe, TinkerTools.hammer };
int[] modifierIds = new int[] { 20, 21, 22, 23, 24, 25 };
String[] renderNames = new String[] { "skeletonskull", "zombiehead", "creeperhead", "endermanhead", "witherskeletonskull", "netherstar" };
for (ToolCore tool : tools)
for (int index = 0; index < modifierIds.length; ++index)
TConstructClientRegistry.addEffectRenderMapping(tool, modifierIds[index], "iguanatweakstconstruct", renderNames[index], true);
}
// LEVELING MODIFIER
if (IguanaConfig.toolLeveling)
{
Log.info("Adding leveling active modifier");
//TConstructRegistry.activeModifiers.add(0, new IguanaActiveToolMod());
}
}
}
@@ -1,35 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.tweaks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.item.crafting.IRecipe;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
public class RecipeRemover {
@SuppressWarnings("unchecked")
public static void removeAnyRecipe (ItemStack resultItem)
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < recipes.size(); i++)
{
IRecipe tmpRecipe = recipes.get(i);
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
recipes.remove(i--);
}
}
@SuppressWarnings("unchecked")
public static void removeFurnaceRecipe (Item item, int metadata)
{
Map<List<Integer>, ItemStack> recipes = FurnaceRecipes.smelting().getSmeltingList();
recipes.remove(Arrays.asList(item, metadata));
}
}
@@ -1,50 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.tweaks;
import iguanaman.iguanatweakstconstruct.old.IguanaConfig;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ChestGenHooks;
public class RemoveVanillaTools {
public static void init()
{
//Remove vanilla tools
Log.info("Removing vanilla tool recipes");
//Wood
if (IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedWoodParts.contains(2) || IguanaConfig.restrictedWoodParts.contains(9))
RemoveVanillaTool(Items.wooden_pickaxe);
if (IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedWoodParts.contains(3))
RemoveVanillaTool(Items.wooden_shovel);
if (IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedWoodParts.contains(4))
RemoveVanillaTool(Items.wooden_axe);
if (IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedWoodParts.contains(5) || IguanaConfig.restrictedWoodParts.contains(6))
RemoveVanillaTool(Items.wooden_sword);
//Stone
if (!IguanaConfig.allowStoneTools || IguanaConfig.restrictedWoodParts.contains(1)
|| IguanaConfig.restrictedFlintParts.contains(2) || IguanaConfig.restrictedWoodParts.contains(9))
RemoveVanillaTool(Items.stone_pickaxe);
if (!IguanaConfig.allowStoneTools || IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedFlintParts.contains(3))
RemoveVanillaTool(Items.stone_shovel);
if (!IguanaConfig.allowStoneTools || IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedFlintParts.contains(4))
RemoveVanillaTool(Items.stone_axe);
if (!IguanaConfig.allowStoneTools || IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedFlintParts.contains(5) || IguanaConfig.restrictedWoodParts.contains(6))
RemoveVanillaTool(Items.stone_sword);
}
public static void RemoveVanillaTool(Item item)
{
RecipeRemover.removeAnyRecipe(new ItemStack(item));
ChestGenHooks.getInfo(ChestGenHooks.BONUS_CHEST).removeItem(new ItemStack(item));
}
}
@@ -1,185 +0,0 @@
package iguanaman.iguanatweakstconstruct.old.tweaks;
import cpw.mods.fml.common.registry.GameRegistry;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import iguanaman.iguanatweakstconstruct.old.IguanaConfig;
import iguanaman.iguanatweakstconstruct.old.IguanaPartBuildRecipe;
import iguanaman.iguanatweakstconstruct.old.IguanaToolBuildRecipe;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.tools.ToolMaterial;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.tools.TinkerTools;
import tconstruct.tools.items.Pattern;
import tconstruct.world.TinkerWorld;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
public class VariousTweaks {
public static void init()
{
// SUPPRESS MISSING TOOL LOGS
try
{
Class clazz = Class.forName(tconstruct.tools.TinkerTools.class.getName());
Field fld = clazz.getField("supressMissingToolLogs");
fld.setBoolean(fld, true);
}
catch (Exception e)
{
Log.warn("Failed to suppress missing tool logs");
e.printStackTrace();
}
//REMOVE STONE TORCH
if (IguanaConfig.removeStoneTorchRecipe)
{
Log.info("Removing stone torch recipe");
RecipeRemover.removeAnyRecipe(new ItemStack(TinkerWorld.stoneTorch, 4));
}
// GRAVEL TO FLINT RECIPE
if (IguanaConfig.addFlintRecipe) {
Log.info("Adding gravel to flint recipe");
GameRegistry.addShapelessRecipe(new ItemStack(Items.flint), new Object[] {Blocks.gravel, Blocks.gravel, Blocks.gravel, Blocks.gravel});
}
//SOFTEN SEARED BLOCKS
Log.info("Softening seared blocks");
TinkerSmeltery.smeltery.setHardness(1.5F);
TinkerSmeltery.lavaTank.setHardness(1.5F);
TinkerSmeltery.searedBlock.setHardness(1.5F);
TinkerSmeltery.castingChannel.setHardness(1.5F);
// REUSABLE PARTS
Log.info("Making non-metal parts reusable in part builder");
int[] nonMetals = { 0, 1, 3, 4, 5, 6, 7, 8, 9, 17 };
PatternBuilder pb = PatternBuilder.instance;
for (int p = 0; p < IguanaTweaksTConstruct.toolParts.size(); ++p)
for (int m = 0; m < nonMetals.length; ++m)
{
ToolMaterial mat = TConstructRegistry.getMaterial(m);
int cost = ((Pattern)TinkerTools.woodPattern).getPatternCost(new ItemStack(TinkerTools.woodPattern, 1, p + 1));
cost = Math.round(cost / 2f - 0.5f);
if (cost > 0)
{
Item part = IguanaTweaksTConstruct.toolParts.get(p);
ItemStack partStack = new ItemStack(part, 1, nonMetals[m]);
pb.registerMaterial(partStack, cost, mat.name());
}
}
// REMOVE RESTRICTED PARTS FROM TINKERS HOUSE LOOT
Log.info("Removing restricted parts from Tinker House chest");
for (int i = 0; i < IguanaTweaksTConstruct.toolParts.size(); ++i)
{
Item part = IguanaTweaksTConstruct.toolParts.get(i);
if (IguanaConfig.restrictedWoodParts.contains(i+1))
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 0));
if (!IguanaConfig.allowStoneTools || IguanaConfig.restrictedStoneParts.contains(i+1))
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 1));
if (IguanaConfig.restrictedFlintParts.contains(i+1))
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 3));
if (IguanaConfig.restrictedCactusParts.contains(i+1))
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 4));
if (IguanaConfig.restrictedBoneParts.contains(i+1))
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 5));
if (IguanaConfig.restrictedPaperParts.contains(i+1))
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 9));
if (IguanaConfig.restrictedSlimeParts.contains(i+1))
{
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 8));
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 17));
}
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 2)); //iron
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 6)); //obsidian
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 10)); //cobalt
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 11)); //ardite
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 12)); //manyullum
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 14)); //bronze
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 15)); //alumite
TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(part, 1, 16)); //steel
}
// SIMPLE WOOD PATTERN CRAFTING RECIPE
if (IguanaConfig.easyBlankPatternRecipe)
{
Log.info("Adding easy blank pattern recipe");
GameRegistry.addShapedRecipe(new ItemStack(TinkerTools.blankPattern), "ss", "ss", 's', new ItemStack(Items.stick));
}
//ROTATING PATTERN CRAFTING
if (IguanaConfig.easyPatternCrafting)
{
Log.info("Adding rotating pattern crafting recipes");
// TODO: Find Crafting Handler replacement
//GameRegistry.registerCraftingHandler(new IguanaPatternCraftingHandler());
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"
};
List<Integer> patternIds = new ArrayList<Integer>();
for (int x = 1; x < patternName.length; x++)
if (!IguanaConfig.restrictedBoneParts.contains(x) || !IguanaConfig.restrictedCactusParts.contains(x)
|| !IguanaConfig.restrictedFlintParts.contains(x) || !IguanaConfig.restrictedPaperParts.contains(x)
|| !IguanaConfig.restrictedSlimeParts.contains(x) || !IguanaConfig.restrictedWoodParts.contains(x)
|| IguanaConfig.allowStoneTools && !IguanaConfig.restrictedFlintParts.contains(x)
|| x >= 23)
patternIds.add(x);
GameRegistry.addShapelessRecipe(new ItemStack(TinkerTools.woodPattern, 1, patternIds.get(0)), new ItemStack(TinkerTools.blankPattern, 1, 0));
for (int x = 0; x < patternIds.size(); x++)
{
int pmeta = patternIds.get(x);
if (x == patternIds.size() - 1)
GameRegistry.addShapelessRecipe(new ItemStack(TinkerTools.woodPattern, 1, patternIds.get(0)), new ItemStack(TinkerTools.woodPattern, 1, pmeta));
else
GameRegistry.addShapelessRecipe(new ItemStack(TinkerTools.woodPattern, 1, patternIds.get(x+1)), new ItemStack(TinkerTools.woodPattern, 1, pmeta));
}
}
// ALTERNATIVE PART CRAFTING
if (IguanaConfig.easyPartCrafting)
{
Log.info("Adding easy part crafting");
GameRegistry.addRecipe(new IguanaPartBuildRecipe());
// TODO: Find crafting Handler replacement
//GameRegistry.registerCraftingHandler(new IguanaPartCraftingHandler());
}
// ALTERNATIVE TOOL CRAFTING
if (IguanaConfig.easyToolCreation || IguanaConfig.easyToolModification)
{
Log.info("Adding easy tool crafting");
GameRegistry.addRecipe(new IguanaToolBuildRecipe());
}
}
}