├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── resources ├── pack.mcmeta ├── assets │ └── iguanatweakstconstruct │ │ ├── sounds │ │ ├── chime.ogg │ │ └── chicken.ogg │ │ ├── textures │ │ ├── items │ │ │ ├── saw.png │ │ │ ├── bathat.png │ │ │ ├── sawArdite.png │ │ │ ├── sawCobalt.png │ │ │ ├── twinkie1.png │ │ │ ├── twinkie2.png │ │ │ ├── bucketHoley.png │ │ │ ├── endermanJaw.png │ │ │ ├── sawManyullyn.png │ │ │ ├── skull_blaze.png │ │ │ ├── skull_blizz.png │ │ │ ├── skull_pigman.png │ │ │ ├── clayBucketLava.png │ │ │ ├── clayBucketMilk.png │ │ │ ├── clayBucket_tin.png │ │ │ ├── rubber_chicken.png │ │ │ ├── skull_enderman.png │ │ │ ├── clayBucketCracked.png │ │ │ ├── clayBucketFired.png │ │ │ ├── clayBucketUnfired.png │ │ │ ├── clayBucketWater.png │ │ │ ├── clayBucket_ardite.png │ │ │ ├── clayBucket_blood.png │ │ │ ├── clayBucket_bronze.png │ │ │ ├── clayBucket_cobalt.png │ │ │ ├── clayBucket_copper.png │ │ │ ├── clayBucket_ender.png │ │ │ ├── clayBucket_glass.png │ │ │ ├── clayBucket_glue.png │ │ │ ├── clayBucket_gold.png │ │ │ ├── clayBucket_invar.png │ │ │ ├── clayBucket_iron.png │ │ │ ├── clayBucket_lead.png │ │ │ ├── clayBucket_lumium.png │ │ │ ├── clayBucket_nickel.png │ │ │ ├── clayBucket_shiny.png │ │ │ ├── clayBucket_silver.png │ │ │ ├── clayBucket_slime.png │ │ │ ├── clayBucket_steel.png │ │ │ ├── clayBucket_stone.png │ │ │ ├── clayBucket_alubrass.png │ │ │ ├── clayBucket_aluminum.png │ │ │ ├── clayBucket_alumite.png │ │ │ ├── clayBucket_electrum.png │ │ │ ├── clayBucket_emerald.png │ │ │ ├── clayBucket_enderium.png │ │ │ ├── clayBucket_mithril.png │ │ │ ├── clayBucket_obsidian.png │ │ │ ├── clayBucket_pigiron.png │ │ │ ├── clayBucket_signalum.png │ │ │ ├── clayBucket_angmallen.png │ │ │ ├── clayBucket_manyullyn.png │ │ │ ├── hammer │ │ │ │ ├── blazehead_hammer_effect.png │ │ │ │ ├── blizzhead_hammer_effect.png │ │ │ │ ├── creeperhead_hammer_effect.png │ │ │ │ ├── netherstar_hammer_effect.png │ │ │ │ ├── zombiehead_hammer_effect.png │ │ │ │ ├── endermanhead_hammer_effect.png │ │ │ │ ├── skeletonskull_hammer_effect.png │ │ │ │ ├── zombiepigmanhead_hammer_effect.png │ │ │ │ └── witherskeletonskull_hammer_effect.png │ │ │ └── pickaxe │ │ │ │ ├── blazehead_pickaxe_effect.png │ │ │ │ ├── blizzhead_pickaxe_effect.png │ │ │ │ ├── creeperhead_pickaxe_effect.png │ │ │ │ ├── netherstar_pickaxe_effect.png │ │ │ │ ├── zombiehead_pickaxe_effect.png │ │ │ │ ├── endermanhead_pickaxe_effect.png │ │ │ │ ├── skeletonskull_pickaxe_effect.png │ │ │ │ ├── zombiepigmanhead_pickaxe_effect.png │ │ │ │ └── witherskeletonskull_pickaxe_effect.png │ │ └── models │ │ │ ├── bucket_helmet.png │ │ │ └── clayBucket_helmet.png │ │ └── sounds.json └── mcmod.info ├── src ├── api │ ├── java │ │ ├── mcp │ │ │ └── mobius │ │ │ │ └── waila │ │ │ │ └── api │ │ │ │ ├── package-info.java │ │ │ │ ├── IWailaFMPDecorator.java │ │ │ │ ├── IWailaBlockDecorator.java │ │ │ │ ├── IWailaFMPProvider.java │ │ │ │ ├── IWailaEntityProvider.java │ │ │ │ ├── IWailaSummaryProvider.java │ │ │ │ ├── IWailaEntityAccessor.java │ │ │ │ ├── IWailaFMPAccessor.java │ │ │ │ ├── IWailaConfigHandler.java │ │ │ │ ├── IWailaDataAccessor.java │ │ │ │ ├── SpecialChars.java │ │ │ │ ├── IWailaDataProvider.java │ │ │ │ ├── IWailaBlock.java │ │ │ │ └── IWailaRegistrar.java │ │ ├── cofh │ │ │ ├── core │ │ │ │ └── item │ │ │ │ │ └── IEqualityOverrideItem.java │ │ │ └── api │ │ │ │ └── energy │ │ │ │ └── IEnergyContainerItem.java │ │ ├── powercrystals │ │ │ └── minefactoryreloaded │ │ │ │ └── api │ │ │ │ ├── ILiquidDrinkHandler.java │ │ │ │ ├── MobDrop.java │ │ │ │ ├── IFactoryGrindable.java │ │ │ │ ├── HarvestType.java │ │ │ │ ├── ValuedItem.java │ │ │ │ └── IFactoryHarvestable.java │ │ └── thaumcraft │ │ │ └── api │ │ │ ├── crafting │ │ │ └── IInfusionStabiliser.java │ │ │ └── IGoggles.java │ └── resources │ │ └── TConstruct_at.cfg └── main │ └── java │ └── iguanaman │ └── iguanatweakstconstruct │ ├── proxy │ ├── ClientProxy.java │ ├── ServerProxy.java │ └── CommonProxy.java │ ├── modcompat │ └── fmp │ │ ├── CommonFMPProxy.java │ │ ├── SawStrengthHandler.java │ │ ├── ClientFMPProxy.java │ │ └── IguanaItemSawRenderer.java │ ├── mobheads │ ├── proxy │ │ ├── MobHeadCommonProxy.java │ │ └── MobHeadClientProxy.java │ ├── tileentities │ │ └── IguanaSkullTileEntity.java │ ├── models │ │ ├── ModelHeadwear.java │ │ ├── ModelBucketHelmet.java │ │ └── ModelEnderManHead.java │ ├── handlers │ │ ├── RenderPlayerHandler.java │ │ └── MobHeadHandler.java │ ├── blocks │ │ └── IguanaSkullBlock.java │ ├── items │ │ └── Wearable.java │ └── IguanaMobHeads.java │ ├── override │ ├── IOverride.java │ ├── XPAdjustmentMap.java │ ├── ExtraHarvestLevelHandler.java │ ├── IguanaOverride.java │ ├── HarvestLevelNameOverride.java │ └── ToolOverride.java │ ├── tweaks │ ├── handlers │ │ ├── CastHandler.java │ │ ├── FlintHandler.java │ │ ├── StringBindingHandler.java │ │ ├── VanillaHoeNerfHandler.java │ │ ├── VanillaToolNerfHandler.java │ │ ├── VanillaBowNerfHandler.java │ │ ├── VanillaSwordNerfHandler.java │ │ └── StoneToolHandler.java │ ├── modifiers │ │ ├── ModLimitedToolRepair.java │ │ └── ModFluxExpensive.java │ ├── PartCraftingRecipe.java │ ├── RepairCraftingRecipe.java │ └── ToolCraftingRecipe.java │ ├── debug │ ├── IguanaDebug.java │ ├── DebugTooltipHandler.java │ └── DebugCommand.java │ ├── leveling │ ├── modifiers │ │ ├── ModCritical.java │ │ ├── ModMiningLevelBoost.java │ │ ├── ModShoddy.java │ │ └── ModXpAwareRedstone.java │ ├── handlers │ │ └── MobHeadTooltipHandler.java │ └── commands │ │ ├── IguanaCommandToolXP.java │ │ └── IguanaCommandLevelUpTool.java │ ├── util │ ├── Log.java │ ├── ModSupportHelper.java │ ├── TooltipHelper.java │ └── HarvestLevels.java │ ├── AntiChiselDupeHandler.java │ ├── claybuckets │ ├── items │ │ ├── ClayBucketMilk.java │ │ ├── ClayBucketTinkerLiquids.java │ │ └── ClayBucket.java │ └── ClayBucketHandler.java │ ├── replacing │ ├── IguanaToolPartReplacing.java │ └── PartToolTipHandler.java │ ├── PulsarCFG.java │ ├── worldgen │ └── IguanaWorldGen.java │ ├── commands │ ├── CommandDumpOredict.java │ ├── CommandDumpTools.java │ └── CommandIAmADirtyCheater.java │ ├── reference │ └── Reference.java │ ├── harvestlevels │ ├── VanillaToolTipHandler.java │ ├── modifiers │ │ └── ModBonusMiningLevel.java │ └── IguanaHarvestLevelTweaks.java │ ├── restriction │ ├── IguanaPartRestriction.java │ └── PartRestrictionHandler.java │ └── ToolUpdateRecipe.java ├── hd-textures └── john-smith │ └── assets │ └── iguanatweakstconstruct │ └── textures │ └── items │ ├── skull_blaze.png │ ├── skull_enderman.png │ ├── skull_pigman.png │ └── pickaxe │ ├── creeperhead_pickaxe_effect.png │ ├── netherstar_pickaxe_effect.png │ ├── zombiehead_pickaxe_effect.png │ ├── endermanhead_pickaxe_effect.png │ ├── skeletonskull_pickaxe_effect.png │ └── witherskeletonskull_pickaxe_effect.png ├── version.json ├── .gitattributes ├── .gitignore ├── README.md ├── gradlew.bat └── Original_extratic_materials.txt /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'IguanaTinkerTweaks' -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "pack_format": 1, 4 | "description": "Resources used for Iguana's Tinker Tweaks" 5 | } 6 | } -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/package-info.java: -------------------------------------------------------------------------------- 1 | @API(apiVersion="1.0",owner="Waila",provides="WailaAPI") 2 | package mcp.mobius.waila.api; 3 | import cpw.mods.fml.common.API; -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/sounds/chime.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/sounds/chime.ogg -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/proxy/ClientProxy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.proxy; 2 | 3 | public class ClientProxy extends CommonProxy { 4 | 5 | } -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/proxy/ServerProxy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.proxy; 2 | 3 | public class ServerProxy extends CommonProxy { 4 | 5 | } -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/sounds/chicken.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/sounds/chicken.ogg -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/saw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/saw.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/bathat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/bathat.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/sawArdite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/sawArdite.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/sawCobalt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/sawCobalt.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/twinkie1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/twinkie1.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/twinkie2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/twinkie2.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/bucketHoley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/bucketHoley.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/endermanJaw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/endermanJaw.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/sawManyullyn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/sawManyullyn.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/skull_blaze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/skull_blaze.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/skull_blizz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/skull_blizz.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/skull_pigman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/skull_pigman.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucketLava.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucketLava.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucketMilk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucketMilk.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_tin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_tin.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/rubber_chicken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/rubber_chicken.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/skull_enderman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/skull_enderman.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/models/bucket_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/models/bucket_helmet.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucketCracked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucketCracked.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucketFired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucketFired.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucketUnfired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucketUnfired.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucketWater.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucketWater.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_ardite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_ardite.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_blood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_blood.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_bronze.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_cobalt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_cobalt.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_copper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_copper.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_ender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_ender.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_glass.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_glue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_glue.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_gold.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_invar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_invar.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_iron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_iron.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_lead.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_lumium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_lumium.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_nickel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_nickel.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_shiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_shiny.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_silver.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_slime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_slime.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_steel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_steel.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_stone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_stone.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_alubrass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_alubrass.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_aluminum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_aluminum.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_alumite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_alumite.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_electrum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_electrum.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_emerald.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_emerald.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_enderium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_enderium.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_mithril.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_mithril.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_obsidian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_obsidian.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_pigiron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_pigiron.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_signalum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_signalum.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/models/clayBucket_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/models/clayBucket_helmet.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_angmallen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_angmallen.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/clayBucket_manyullyn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/clayBucket_manyullyn.png -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/modcompat/fmp/CommonFMPProxy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.modcompat.fmp; 2 | 3 | public class CommonFMPProxy { 4 | public void updateSawRenderers() {} 5 | } 6 | -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/skull_blaze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/skull_blaze.png -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/skull_enderman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/skull_enderman.png -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/skull_pigman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/skull_pigman.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/blazehead_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/blazehead_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/blizzhead_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/blizzhead_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/creeperhead_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/creeperhead_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/netherstar_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/netherstar_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/zombiehead_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/zombiehead_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/blazehead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/blazehead_pickaxe_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/blizzhead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/blizzhead_pickaxe_effect.png -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/proxy/CommonProxy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.proxy; 2 | 3 | public class CommonProxy 4 | { 5 | 6 | public void registerRenderers() {} 7 | 8 | public void registerSounds() {} 9 | } -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/endermanhead_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/endermanhead_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/skeletonskull_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/skeletonskull_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/creeperhead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/creeperhead_pickaxe_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/netherstar_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/netherstar_pickaxe_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/zombiehead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/zombiehead_pickaxe_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/zombiepigmanhead_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/zombiepigmanhead_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/endermanhead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/endermanhead_pickaxe_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/skeletonskull_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/skeletonskull_pickaxe_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/zombiepigmanhead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/zombiepigmanhead_pickaxe_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/hammer/witherskeletonskull_hammer_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/hammer/witherskeletonskull_hammer_effect.png -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/textures/items/pickaxe/witherskeletonskull_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/resources/assets/iguanatweakstconstruct/textures/items/pickaxe/witherskeletonskull_pickaxe_effect.png -------------------------------------------------------------------------------- /src/api/java/cofh/core/item/IEqualityOverrideItem.java: -------------------------------------------------------------------------------- 1 | package cofh.core.item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public interface IEqualityOverrideItem { 6 | 7 | public boolean isLastHeldItemEqual(ItemStack current, ItemStack previous); 8 | 9 | } -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/proxy/MobHeadCommonProxy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.proxy; 2 | 3 | public class MobHeadCommonProxy { 4 | 5 | public void initialize() {} 6 | 7 | public void postInit() {} 8 | } 9 | -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/creeperhead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/creeperhead_pickaxe_effect.png -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/netherstar_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/netherstar_pickaxe_effect.png -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/zombiehead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/zombiehead_pickaxe_effect.png -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/endermanhead_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/endermanhead_pickaxe_effect.png -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/skeletonskull_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/skeletonskull_pickaxe_effect.png -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public interface IWailaFMPDecorator { 6 | void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config); 7 | } 8 | -------------------------------------------------------------------------------- /src/api/java/powercrystals/minefactoryreloaded/api/ILiquidDrinkHandler.java: -------------------------------------------------------------------------------- 1 | package powercrystals.minefactoryreloaded.api; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | 5 | public interface ILiquidDrinkHandler 6 | { 7 | public void onDrink(EntityLivingBase player); 8 | } 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 02 15:54:47 CDT 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip 7 | -------------------------------------------------------------------------------- /resources/assets/iguanatweakstconstruct/sounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "chime": { 3 | "category": "player", 4 | "sounds": [ 5 | "chime" 6 | ] 7 | }, 8 | "chicken": { 9 | "category": "player", 10 | "sounds": [ 11 | "chicken" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/witherskeletonskull_pickaxe_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlimeKnights/IguanaTweaksTConstruct/HEAD/hd-textures/john-smith/assets/iguanatweakstconstruct/textures/items/pickaxe/witherskeletonskull_pickaxe_effect.png -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public interface IWailaBlockDecorator { 6 | 7 | void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/override/IOverride.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.override; 2 | 3 | import net.minecraftforge.common.config.Configuration; 4 | 5 | public interface IOverride { 6 | void createDefault(Configuration config); 7 | void processConfig(Configuration config); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/tileentities/IguanaSkullTileEntity.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.tileentities; 2 | 3 | import net.minecraft.tileentity.TileEntitySkull; 4 | 5 | public class IguanaSkullTileEntity extends TileEntitySkull { 6 | 7 | public IguanaSkullTileEntity() {} 8 | 9 | } 10 | -------------------------------------------------------------------------------- /version.json: -------------------------------------------------------------------------------- 1 | { 2 | "versionList": [ 3 | { 4 | "mcVersion": "Minecraft 1.7.10", 5 | "modVersion": "1.7.10-2.1.3", 6 | "changeLog": [ 7 | "Bugfixes galore" 8 | ], 9 | "updateURL":"http://minecraft.curseforge.com/mc-mods/223248-iguanas-tinker-tweaks/files/2230129/download", 10 | "isDirectLink":"true" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "IguanaTweaksTConstruct", 4 | "name": "Iguana Tinker Tweaks", 5 | "description": "Rebalances and adds new features to Tinkers Construct", 6 | "version": "${version}", 7 | "mcversion": "${MCversion}", 8 | "url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2176855", 9 | "authorList": [ 10 | "boni", 11 | "iguana_man" 12 | ] 13 | } 14 | ] -------------------------------------------------------------------------------- /src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java: -------------------------------------------------------------------------------- 1 | package thaumcraft.api.crafting; 2 | 3 | import net.minecraft.world.World; 4 | 5 | /** 6 | * 7 | * @author Azanor 8 | * 9 | * Blocks that implement this interface act as infusion crafting stabilisers like candles and skulls 10 | * 11 | */ 12 | public interface IInfusionStabiliser { 13 | 14 | /** 15 | * returns true if the block can stabilise things 16 | */ 17 | public boolean canStabaliseInfusion(World world, int x, int y, int z); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/api/java/powercrystals/minefactoryreloaded/api/MobDrop.java: -------------------------------------------------------------------------------- 1 | package powercrystals.minefactoryreloaded.api; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.util.WeightedRandom; 5 | 6 | public class MobDrop extends WeightedRandom.Item 7 | { 8 | private ItemStack _stack; 9 | 10 | public MobDrop(int weight, ItemStack stack) 11 | { 12 | super(weight); 13 | _stack = stack; 14 | } 15 | 16 | public ItemStack getStack() 17 | { 18 | if(_stack == null) return null; 19 | return _stack.copy(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/override/XPAdjustmentMap.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.override; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class XPAdjustmentMap 7 | { 8 | private static Map map = new HashMap(); 9 | 10 | public static float get(String s) 11 | { 12 | if (!map.containsKey(s)) 13 | { 14 | map.put(s, 1.0f); 15 | } 16 | return map.get(s); 17 | } 18 | 19 | public static void put(String s, float f) 20 | { 21 | map.put(s, f); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/CastHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import tconstruct.library.event.SmelteryCastedEvent; 5 | import tconstruct.library.util.IPattern; 6 | 7 | public class CastHandler { 8 | @SubscribeEvent 9 | public void onCasted(SmelteryCastedEvent.CastingTable event) 10 | { 11 | if(event.output.getItem() instanceof IPattern) 12 | event.consumeCast = true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #ant stuff 2 | /bin/ 3 | /download/ 4 | #Remove OS generated garbage 5 | */.DS_Store 6 | .DS_Store 7 | .DS_Store? 8 | .Spotlight-V100 9 | .Trashes 10 | Icon? 11 | ehthumbs.db 12 | Thumbs.db 13 | #gradle stuff 14 | /.gradle 15 | /build/ 16 | /run/ 17 | #IDEA files from Gradle 18 | .idea/ 19 | /*.iml 20 | /*.ipr 21 | /*.iws 22 | #Vim backups 23 | *~ 24 | #manual version override 25 | version.properties 26 | #eclipse stuffs 27 | #eclipse stuffs 28 | /.classpath 29 | /.project 30 | /.settings/ 31 | /debug/ 32 | *.lock 33 | /.metadata/ 34 | /config/ 35 | /logs/ 36 | options.txt 37 | /saves/ 38 | /out 39 | /runServer 40 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/debug/IguanaDebug.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.debug; 2 | 3 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 4 | import mantle.pulsar.pulse.Handler; 5 | import mantle.pulsar.pulse.Pulse; 6 | import net.minecraftforge.common.MinecraftForge; 7 | 8 | @Pulse(id = "Debug", description = "Stuff used for debugging. You probably don't want this.", defaultEnable = false) 9 | public class IguanaDebug { 10 | @Handler 11 | public void postInit(FMLPostInitializationEvent event) 12 | { 13 | MinecraftForge.EVENT_BUS.register(new DebugTooltipHandler()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/api/java/thaumcraft/api/IGoggles.java: -------------------------------------------------------------------------------- 1 | package thaumcraft.api; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | import net.minecraft.item.ItemStack; 5 | 6 | /** 7 | * 8 | * @author Azanor 9 | * 10 | * Equipped head slot items that extend this class will be able to perform most functions that 11 | * goggles of revealing can apart from view nodes which is handled by IRevealer. 12 | * 13 | */ 14 | 15 | public interface IGoggles { 16 | 17 | /* 18 | * If this method returns true things like block essentia contents will be shown. 19 | */ 20 | public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import java.util.List; 4 | 5 | import net.minecraft.item.ItemStack; 6 | 7 | public interface IWailaFMPProvider { 8 | /* The classical HEAD/BODY/TAIL text getters */ 9 | List getWailaHead(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); 10 | List getWailaBody(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); 11 | List getWailaTail(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); 12 | } 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | IguanaTweaks for Tinkers Construct 2 | ================================== 3 | 4 | The not really official repo for Iguana Tweaks for [Tinker's Construct](https://github.com/SlimeKnights/TinkersConstruct). 5 | Current Minecraft Version: 1.7.10 6 | 7 | Everything is highly work in Progress. 8 | 9 | ##Special thanks go to: 10 | * Glassmaker for starting the port and being awesome in general 11 | * mDiyo, progwml6, Sunstrike and everybody else who worked on Tinkers and Mantle 12 | * Squeek502 for [TiC Tooltips](https://github.com/squeek502/TiC-Tooltips) which allowed me to do Tooltips properly 13 | * iguana_man for creating the original Iguana Tweaks for Tinkers Construct 14 | * MoxieGrrl for lots of testing and being a darling. 15 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/leveling/modifiers/ModCritical.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.leveling.modifiers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.util.EnumChatFormatting; 5 | import net.minecraft.util.StatCollector; 6 | import tconstruct.modifiers.tools.ModBoolean; 7 | 8 | public class ModCritical extends ModBoolean { 9 | public static ModCritical modCritical = new ModCritical("Critical Chance", EnumChatFormatting.WHITE.toString(), StatCollector.translateToLocal("materialtraits.critical")); 10 | 11 | public ModCritical(String tag, String c, String tip) { 12 | super(new ItemStack[0], 0, tag, c, tip); 13 | } 14 | 15 | @Override 16 | public void addMatchingEffect(ItemStack input) { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/modifiers/ModLimitedToolRepair.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.modifiers; 2 | 3 | import iguanaman.iguanatweakstconstruct.reference.Config; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import tconstruct.modifiers.tools.ModToolRepair; 7 | 8 | public class ModLimitedToolRepair extends ModToolRepair { 9 | @Override 10 | protected boolean canModify(ItemStack tool, ItemStack[] input) { 11 | NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); 12 | int repairCount = tags.getInteger("RepairCount"); 13 | if(repairCount >= Config.maxToolRepairs) 14 | return false; 15 | 16 | return super.canModify(tool, input); 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/models/ModelHeadwear.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.models; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | import net.minecraft.client.model.ModelRenderer; 6 | import net.minecraft.client.model.ModelSkeletonHead; 7 | 8 | @SideOnly(Side.CLIENT) 9 | public class ModelHeadwear extends ModelSkeletonHead 10 | { 11 | public ModelHeadwear(int offsetX, int offsetY, int width, int height) 12 | { 13 | this.textureWidth = width; 14 | this.textureHeight = height; 15 | this.skeletonHead = new ModelRenderer(this, offsetX, offsetY); 16 | this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.4F); 17 | this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); 18 | } 19 | } -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import java.util.List; 4 | 5 | import net.minecraft.entity.Entity; 6 | 7 | public interface IWailaEntityProvider { 8 | 9 | /* A way to get an override on the entity returned by the raytracing */ 10 | Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config); 11 | 12 | /* The classical HEAD/BODY/TAIL text getters */ 13 | List getWailaHead(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); 14 | List getWailaBody(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); 15 | List getWailaTail(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/modcompat/fmp/SawStrengthHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.modcompat.fmp; 2 | 3 | import codechicken.microblock.Saw; 4 | import com.mojang.realmsclient.gui.ChatFormatting; 5 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 6 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 7 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 8 | 9 | public class SawStrengthHandler { 10 | 11 | @SubscribeEvent 12 | public void onTooltip(ItemTooltipEvent event) 13 | { 14 | if(!(event.itemStack.getItem() instanceof Saw)) 15 | return; 16 | 17 | event.toolTip.add(String.format("%sCutting Strength: %s", ChatFormatting.GOLD.toString(), HarvestLevels.getHarvestLevelName(((Saw) event.itemStack.getItem()).getCuttingStrength(event.itemStack)))); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import java.util.LinkedHashMap; 4 | 5 | import net.minecraft.item.ItemStack; 6 | 7 | public interface IWailaSummaryProvider { 8 | /* This interface is used to control the display data in the description screen */ 9 | 10 | /* BASIC TOOLS & ITEMS DATA */ 11 | //EnumToolMaterial getMaterial(ItemStack stack); 12 | //String getMaterialName(ItemStack stack); 13 | //String getEffectiveBlock(ItemStack stack); 14 | //int getHarvestLevel(ItemStack stack); 15 | //float getEfficiencyOnProperMaterial(ItemStack stack); 16 | //int getEnchantability(ItemStack stack); 17 | //int getDamageVsEntity(ItemStack stack); 18 | //int getDurability(ItemStack stack); 19 | 20 | LinkedHashMap getSummary(ItemStack stack, LinkedHashMap currentSummary, IWailaConfigHandler config); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/models/ModelBucketHelmet.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.models; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | import net.minecraft.client.model.ModelRenderer; 6 | 7 | @SideOnly(Side.CLIENT) 8 | public class ModelBucketHelmet extends ModelEnderManHead { 9 | 10 | public ModelBucketHelmet() 11 | { 12 | this.textureWidth = 64; 13 | this.textureHeight = 32; 14 | this.endermanHead = new ModelRenderer(this, 0, 0); 15 | this.endermanHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F); 16 | this.endermanHead.setRotationPoint(0.0F, 0.0F, 0.0F); 17 | this.endermanJaw = new ModelRenderer(this, 0, 16); 18 | this.endermanJaw.addBox(-4.0F, -5.5F, -2.0F, 8, 8, 8, 0.6F); 19 | this.endermanJaw.setRotationPoint(0.0F, 0.0F, 0.0F); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/util/Log.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.util; 2 | 3 | import org.apache.logging.log4j.Level; 4 | import org.apache.logging.log4j.Logger; 5 | 6 | public final class Log { 7 | private Log() {} // non-instantiable 8 | 9 | // initialized by preinit 10 | private static Logger logger; 11 | 12 | public static void init(Logger log) 13 | { 14 | logger = log; 15 | } 16 | 17 | public static void log(Level level, Object obj) 18 | { 19 | logger.log(level, String.valueOf(obj)); 20 | } 21 | 22 | public static void info(Object obj) { log(Level.INFO, obj); } 23 | public static void warn(Object obj) { log(Level.WARN, obj); } 24 | public static void error(Object obj) { log(Level.ERROR, obj); } 25 | public static void debug(Object obj) { log(Level.DEBUG, obj); } 26 | public static void trace(Object obj) { log(Level.TRACE, obj); } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/util/ModSupportHelper.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.util; 2 | 3 | import cpw.mods.fml.common.Loader; 4 | 5 | public final class ModSupportHelper { 6 | private ModSupportHelper() {} // non-instantiable 7 | 8 | public static final boolean tiCTooltips = Loader.isModLoaded("TiCTooltips"); 9 | public static final boolean ExtraTiC = Loader.isModLoaded("ExtraTiC"); 10 | public static final boolean BiomesOPlenty = Loader.isModLoaded("BiomesOPlenty"); 11 | public static final boolean Mekanism = Loader.isModLoaded("Mekanism"); 12 | public static final boolean Metallurgy = Loader.isModLoaded("Metallurgy"); 13 | public static final boolean Natura = Loader.isModLoaded("Natura"); 14 | public static final boolean AppliedEnergistics2 = Loader.isModLoaded("appliedenergistics2"); 15 | 16 | public static final boolean ThermalFoundation = Loader.isModLoaded("ThermalFoundation"); 17 | } 18 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.util.MovingObjectPosition; 7 | import net.minecraft.util.Vec3; 8 | import net.minecraft.world.World; 9 | 10 | /* The Accessor is used to get some basic data out of the game without having to request 11 | * direct access to the game engine. 12 | * It will also return things that are unmodified by the overriding systems (like getWailaStack). 13 | */ 14 | 15 | public interface IWailaEntityAccessor { 16 | World getWorld(); 17 | EntityPlayer getPlayer(); 18 | Entity getEntity(); 19 | MovingObjectPosition getPosition(); 20 | Vec3 getRenderingPosition(); 21 | NBTTagCompound getNBTData(); 22 | int getNBTInteger(NBTTagCompound tag, String keyname); 23 | double getPartialFrame(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/AntiChiselDupeHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 6 | import cpw.mods.fml.common.gameevent.PlayerEvent; 7 | import tconstruct.tools.TinkerTools; 8 | 9 | public class AntiChiselDupeHandler { 10 | @SubscribeEvent 11 | public void onItemCrafted(PlayerEvent.ItemCraftedEvent event) 12 | { 13 | if(event.crafting == null || event.crafting.getItem() != TinkerTools.chisel) 14 | return; 15 | 16 | // the output was a chisel, we therefore either replaced something or fixed it or repaired it or whatever 17 | // we remove the chisel form the crafting grid otherwise it's duped 18 | for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { 19 | ItemStack stack = event.craftMatrix.getStackInSlot(i); 20 | if(stack != null && stack.getItem() == TinkerTools.chisel) 21 | event.craftMatrix.setInventorySlotContents(i, null); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/util/TooltipHelper.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.util; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.lwjgl.input.Keyboard; 5 | 6 | public final class TooltipHelper { 7 | private TooltipHelper() {} // non-instantiable 8 | 9 | // all hail TiC-Tooltips for that information ;) 10 | public static boolean shiftHeld() 11 | { 12 | return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); 13 | } 14 | 15 | // and this too 16 | public static boolean ctrlHeld() 17 | { 18 | // prioritize CONTROL, but allow OPTION as well on Mac (note: GuiScreen's isCtrlKeyDown only checks for the OPTION key on Mac) 19 | boolean isCtrlKeyDown = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); 20 | if (!isCtrlKeyDown && Minecraft.isRunningOnMac) 21 | isCtrlKeyDown = Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA); 22 | 23 | return isCtrlKeyDown; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.tileentity.TileEntity; 7 | import net.minecraft.util.MovingObjectPosition; 8 | import net.minecraft.util.Vec3; 9 | import net.minecraft.world.World; 10 | 11 | /* The Accessor is used to get some basic data out of the game without having to request 12 | * direct access to the game engine. 13 | * It will also return things that are unmodified by the overriding systems (like getWailaStack). 14 | */ 15 | 16 | public interface IWailaFMPAccessor { 17 | World getWorld(); 18 | EntityPlayer getPlayer(); 19 | TileEntity getTileEntity(); 20 | MovingObjectPosition getPosition(); 21 | NBTTagCompound getNBTData(); 22 | NBTTagCompound getFullNBTData(); 23 | int getNBTInteger(NBTTagCompound tag, String keyname); 24 | double getPartialFrame(); 25 | Vec3 getRenderingPosition(); 26 | String getID(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/claybuckets/items/ClayBucketMilk.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.claybuckets.items; 2 | 3 | import iguanaman.iguanatweakstconstruct.claybuckets.IguanaItems; 4 | import iguanaman.iguanatweakstconstruct.reference.Reference; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.init.Items; 7 | import net.minecraft.item.ItemBucketMilk; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.world.World; 10 | 11 | public class ClayBucketMilk extends ItemBucketMilk { 12 | public ClayBucketMilk() { 13 | this.setContainerItem(IguanaItems.clayBucketFired); 14 | 15 | this.setUnlocalizedName(Reference.prefix("clayBucket.Milk")); 16 | this.setTextureName(Reference.resource("clayBucketMilk")); 17 | } 18 | 19 | @Override 20 | public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) 21 | { 22 | ItemStack result = super.onEaten(par1ItemStack, par2World, par3EntityPlayer); 23 | if (result.getItem() == Items.bucket) return new ItemStack(IguanaItems.clayBucketFired); 24 | return result; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/api/java/powercrystals/minefactoryreloaded/api/IFactoryGrindable.java: -------------------------------------------------------------------------------- 1 | package powercrystals.minefactoryreloaded.api; 2 | 3 | import java.util.List; 4 | import java.util.Random; 5 | 6 | import net.minecraft.entity.EntityLivingBase; 7 | import net.minecraft.world.World; 8 | 9 | /** 10 | * @author PowerCrystals 11 | * 12 | * Defines a grindable entity for the Grinder. 13 | */ 14 | public interface IFactoryGrindable 15 | { 16 | /** 17 | * @return The class that this grindable instance is handling. This must be a subtype of EntityLivingBase or the entity will never 18 | * be noticed by the Grinder. 19 | */ 20 | public Class getGrindableEntity(); 21 | 22 | /** 23 | * @param world The world this entity is in. 24 | * @param entity The entity instance being ground. 25 | * @param random A Random instance. 26 | * @return The drops generated when this entity is killed. 27 | */ 28 | public List grind(World world, EntityLivingBase entity, Random random); 29 | 30 | /** 31 | * @param entity The entity instance being ground. 32 | * @return Whether this entity has been fully processed or not. 33 | */ 34 | public boolean processEntity(EntityLivingBase entity); 35 | } 36 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import java.util.HashMap; 4 | import java.util.Set; 5 | 6 | public interface IWailaConfigHandler { 7 | /* Returns a set of all the currently loaded modules in the config handler */ 8 | public Set getModuleNames(); 9 | 10 | /* Returns all the currently available options for a given module */ 11 | public HashMap getConfigKeys(String modName); 12 | 13 | /* Add a new option to a given module 14 | * 15 | * modName is the name of the module to add the option to (ie : Buildcraft, IndustrialCraft2, etc) 16 | * key is the config key (ie : bc.tankcontent, ic2.inputvalue) 17 | * name is the human readable name of the option (ie : "Tank content", "Max EU Input") 18 | * */ 19 | //public void addConfig(String modName, String key, String name); 20 | 21 | /* Returns the current value of an option (true/false) with a default value defvalue if not set*/ 22 | public boolean getConfig(String key, boolean defvalue); 23 | 24 | /* Returns the current value of an option (true/false) with a default value true if not set*/ 25 | public boolean getConfig(String key); 26 | 27 | //public void setConfig(String key, boolean value); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/replacing/IguanaToolPartReplacing.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.replacing; 2 | 3 | import cpw.mods.fml.common.event.FMLInitializationEvent; 4 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 5 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 6 | import iguanaman.iguanatweakstconstruct.reference.Reference; 7 | import mantle.pulsar.pulse.Handler; 8 | import mantle.pulsar.pulse.Pulse; 9 | import net.minecraftforge.common.MinecraftForge; 10 | import tconstruct.library.crafting.ModifyBuilder; 11 | 12 | /** 13 | * Allows the replacement of toolparts. 14 | * Basically it adds a modifier that turns each toolpart into a modifier. 15 | */ 16 | 17 | @Pulse(id = Reference.PULSE_REPLACING, description = "Replace parts of tools") 18 | public class IguanaToolPartReplacing { 19 | 20 | @Handler 21 | public void preInit(FMLPreInitializationEvent event) 22 | { 23 | 24 | } 25 | 26 | @Handler 27 | public void init(FMLInitializationEvent event) 28 | { 29 | ModifyBuilder.registerModifier(new ModPartReplacement()); 30 | } 31 | 32 | @Handler 33 | public void postInit(FMLPostInitializationEvent event) 34 | { 35 | MinecraftForge.EVENT_BUS.register(new PartToolTipHandler()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/FlintHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import net.minecraft.init.Blocks; 5 | import net.minecraft.init.Items; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraftforge.event.world.BlockEvent; 9 | 10 | import java.util.ListIterator; 11 | 12 | public class FlintHandler { 13 | 14 | @SubscribeEvent 15 | public void onBlockHarvested(BlockEvent.HarvestDropsEvent event) 16 | { 17 | // remove flint drop 18 | if(event.block != null && event.block == Blocks.gravel) 19 | { 20 | ListIterator iter = event.drops.listIterator(); 21 | boolean hasGravel = false; 22 | while(iter.hasNext()) 23 | { 24 | Item item = iter.next().getItem(); 25 | if(item == Items.flint) 26 | iter.remove(); 27 | else if(item == Item.getItemFromBlock(Blocks.gravel)) 28 | hasGravel = true; 29 | } 30 | 31 | // ensure that gravel drops 32 | if(!hasGravel) 33 | event.drops.add(new ItemStack(Blocks.gravel)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import net.minecraft.tileentity.TileEntity; 8 | import net.minecraft.util.MovingObjectPosition; 9 | import net.minecraft.util.Vec3; 10 | import net.minecraft.world.World; 11 | import net.minecraftforge.common.util.ForgeDirection; 12 | 13 | /* The Accessor is used to get some basic data out of the game without having to request 14 | * direct access to the game engine. 15 | * It will also return things that are unmodified by the overriding systems (like getWailaStack). 16 | */ 17 | 18 | public interface IWailaDataAccessor { 19 | 20 | World getWorld(); 21 | EntityPlayer getPlayer(); 22 | Block getBlock(); 23 | int getBlockID(); 24 | int getMetadata(); 25 | TileEntity getTileEntity(); 26 | MovingObjectPosition getPosition(); 27 | Vec3 getRenderingPosition(); 28 | NBTTagCompound getNBTData(); 29 | int getNBTInteger(NBTTagCompound tag, String keyname); 30 | double getPartialFrame(); 31 | ForgeDirection getSide(); 32 | ItemStack getStack(); 33 | } 34 | -------------------------------------------------------------------------------- /src/api/java/powercrystals/minefactoryreloaded/api/HarvestType.java: -------------------------------------------------------------------------------- 1 | package powercrystals.minefactoryreloaded.api; 2 | 3 | /** 4 | * @author PowerCrystals 5 | * 6 | * Determines what algorithm the Harvester uses when it encounters this IFactoryHarvestable in the world. 7 | */ 8 | public enum HarvestType 9 | { 10 | /** 11 | * Just break the single block - no special action needed. e.g. Carrots, flowers, wheat. 12 | */ 13 | Normal, 14 | /** 15 | * Search for harvestable blocks adjacent to this block but leave this block. e.g. Pumpkin, melon 16 | */ 17 | Gourd, 18 | /** 19 | * Search for identical blocks above. 20 | */ 21 | Column, 22 | /** 23 | * Search for identical blocks above but leave the bottom one for the future. e.g. Cactus, sugarcane. 24 | */ 25 | LeaveBottom, 26 | /** 27 | * This block is the base of a tree and the harvester should enter tree-cutting mode. 28 | */ 29 | Tree, 30 | /** 31 | * This block is the base of the tree and the harvester should enter tree-cutting mode. 32 | * The tree is searched for in the negative y axis instead. 33 | */ 34 | TreeFlipped, 35 | /** 36 | * This block is part of a tree as above. 37 | */ 38 | TreeLeaf, 39 | /** 40 | * This block is part of a tree as above, but fruits are cut before logs. e.g. cocoa 41 | * The tree is not searched for. 42 | */ 43 | TreeFruit 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/StringBindingHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 5 | import net.minecraft.init.Items; 6 | import net.minecraft.item.ItemStack; 7 | import tconstruct.library.TConstructRegistry; 8 | import tconstruct.library.event.ToolBuildEvent; 9 | import tconstruct.library.event.ToolCraftEvent; 10 | import tconstruct.tools.TinkerTools; 11 | 12 | public class StringBindingHandler { 13 | 14 | @SubscribeEvent 15 | public void onToolBuild(ToolBuildEvent event) 16 | { 17 | if(event.accessoryStack == null || event.accessoryStack.getItem() == null) 18 | return; 19 | 20 | if(event.accessoryStack.getItem() == Items.string) 21 | event.accessoryStack = new ItemStack(TinkerTools.binding, 1, 40); // string binding 22 | 23 | } 24 | 25 | @SubscribeEvent 26 | public void onToolCraft(ToolCraftEvent event) 27 | { 28 | // we don't allow any string tools. 29 | // This basically is to hide the string material from players, since there are no craftable string parts 30 | if(event.materials[0] == TConstructRegistry.getMaterial(40)) 31 | event.setResult(Event.Result.DENY); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/debug/DebugTooltipHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.debug; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 5 | import net.minecraft.block.Block; 6 | import net.minecraft.init.Blocks; 7 | import net.minecraft.util.EnumChatFormatting; 8 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 9 | 10 | public class DebugTooltipHandler { 11 | @SubscribeEvent 12 | public void onItemToolTip(ItemTooltipEvent event) { 13 | if (event.entityPlayer == null) 14 | return; 15 | if(event.itemStack == null) 16 | return; 17 | 18 | Block block = Block.getBlockFromItem(event.itemStack.getItem()); 19 | if(block == null || block== Blocks.air) 20 | return; 21 | int meta = event.itemStack.getItemDamage(); 22 | if(meta > 15) 23 | return; 24 | String toolclass = block.getHarvestTool(meta); 25 | 26 | int hlvl = block.getHarvestLevel(meta); 27 | if(hlvl >= 0) 28 | event.toolTip.add(EnumChatFormatting.GOLD + String.format("Mineable with: %s %s", HarvestLevels.getHarvestLevelName(hlvl), toolclass)); 29 | else 30 | event.toolTip.add(EnumChatFormatting.GOLD + "Mineable with: Unknown"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/modifiers/ModFluxExpensive.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.modifiers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import tconstruct.modifiers.tools.ModFlux; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class ModFluxExpensive extends ModFlux { 10 | 11 | public ModFluxExpensive(ArrayList batteries) { 12 | this.batteries = batteries; 13 | } 14 | 15 | @Override 16 | public boolean matches(ItemStack[] input, ItemStack tool) { 17 | return super.matches(input, tool) && canModify(tool, input); 18 | } 19 | 20 | // needs 2 modifiers 21 | @Override 22 | protected boolean canModify(ItemStack tool, ItemStack[] input) { 23 | NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); 24 | return tags.getInteger("Modifiers") > 1 && !tags.getBoolean(key); //Will fail if the modifier is false or the tag doesn't exist 25 | } 26 | 27 | @Override 28 | public void modify(ItemStack[] input, ItemStack tool) { 29 | super.modify(input, tool); 30 | 31 | // substract additional modifier 32 | NBTTagCompound tags = tool.getTagCompound(); 33 | int modifiers = tags.getCompoundTag("InfiTool").getInteger("Modifiers"); 34 | modifiers -= 1; 35 | tags.getCompoundTag("InfiTool").setInteger("Modifiers", modifiers); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/api/java/powercrystals/minefactoryreloaded/api/ValuedItem.java: -------------------------------------------------------------------------------- 1 | package powercrystals.minefactoryreloaded.api; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public class ValuedItem 6 | { 7 | public final int value; 8 | public final ItemStack item; 9 | public final String key; 10 | public final Object object; 11 | 12 | public ValuedItem(int v, ItemStack i) 13 | { 14 | value = v; 15 | item = i; 16 | key = null; 17 | object = null; 18 | } 19 | 20 | public ValuedItem(String v, Object i) 21 | { 22 | value = -1; 23 | item = null; 24 | key = v; 25 | object = i; 26 | } 27 | 28 | /** 29 | * Presently unused but included so that if they do get used in the future, 30 | * people including this in their jar and loading before MFR don't destroy everyone 31 | */ 32 | 33 | public ValuedItem(int v, Object i) 34 | { 35 | value = v; 36 | item = null; 37 | key = null; 38 | object = i; 39 | } 40 | 41 | public ValuedItem(String v, ItemStack i) 42 | { 43 | value = -1; 44 | item = i; 45 | key = v; 46 | object = null; 47 | } 48 | 49 | public ValuedItem(int v, String k, ItemStack i) 50 | { 51 | value = v; 52 | item = i; 53 | key = k; 54 | object = null; 55 | } 56 | 57 | public ValuedItem(int v, String k, Object i) 58 | { 59 | value = v; 60 | item = null; 61 | key = k; 62 | object = i; 63 | } 64 | 65 | public ValuedItem(int v, String k, ItemStack i, Object o) 66 | { 67 | value = v; 68 | item = i; 69 | key = k; 70 | object = o; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/PulsarCFG.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct; 2 | 3 | import cpw.mods.fml.common.Loader; 4 | import mantle.pulsar.config.ForgeCFG; 5 | import mantle.pulsar.config.IConfiguration; 6 | import mantle.pulsar.pulse.PulseMeta; 7 | import net.minecraftforge.common.config.Configuration; 8 | 9 | import java.io.File; 10 | 11 | /** Reimplementation of mantle.pulsar.config because static config */ 12 | public class PulsarCFG implements IConfiguration { 13 | private static Configuration config; 14 | private final File confFile; 15 | private final String description; 16 | 17 | /** 18 | * Creates a new Configuration object. 19 | * 20 | * Do NOT make this the same as the overall mod configuration; it will clobber it! 21 | * 22 | * @param confFile The config file 23 | * @param description The description for the group that the config entries will be placed in. 24 | */ 25 | public PulsarCFG (File confFile, String description) { 26 | this.confFile = confFile; 27 | this.description = description; 28 | } 29 | 30 | @Override 31 | public void load() { 32 | config = new Configuration(confFile); 33 | config.load(); 34 | } 35 | 36 | @Override 37 | public boolean isModuleEnabled(PulseMeta meta) { 38 | return config.get(description, meta.getId(), meta.isEnabled(), meta.getDescription()).getBoolean(meta.isEnabled()); 39 | } 40 | 41 | @Override 42 | public void flush() { 43 | if(config.hasChanged()) 44 | config.save(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/worldgen/IguanaWorldGen.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.worldgen; 2 | 3 | import cpw.mods.fml.common.event.FMLInitializationEvent; 4 | import iguanaman.iguanatweakstconstruct.reference.Reference; 5 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 6 | import mantle.pulsar.pulse.Handler; 7 | import mantle.pulsar.pulse.Pulse; 8 | import net.minecraftforge.common.ChestGenHooks; 9 | 10 | @Pulse(id = Reference.PULSE_WORLDGEN, description = "This module takes care of additional awesome dungeon loot.") 11 | public class IguanaWorldGen { 12 | @Handler 13 | public void init(FMLInitializationEvent event) 14 | { 15 | // add some a starting weapon to bonus chests! 16 | ChestGenHooks.addItem(ChestGenHooks.BONUS_CHEST, new RandomWeaponChestContent(0,1, 10, 0,0, HarvestLevels._1_flint, 3)); 17 | 18 | // awesome dungeon loot! 19 | ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST, new RandomWeaponChestContent(0,1, 2, 1,2, HarvestLevels._5_diamond, 4)); 20 | ChestGenHooks.addItem(ChestGenHooks.MINESHAFT_CORRIDOR, new RandomWeaponChestContent(0,1, 2, 0,0, HarvestLevels._2_copper, 2)); 21 | ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST, new RandomWeaponChestContent(0,1, 2, 0,2, HarvestLevels._5_diamond, 3)); 22 | ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST, new RandomWeaponChestContent(0,1, 2, 1,1, HarvestLevels._5_diamond, 3)); 23 | ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, new RandomWeaponChestContent(0,1, 2, 2,2, HarvestLevels._5_diamond, 4)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/proxy/MobHeadClientProxy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.proxy; 2 | 3 | import cpw.mods.fml.client.registry.ClientRegistry; 4 | import cpw.mods.fml.common.Loader; 5 | import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads; 6 | import iguanaman.iguanatweakstconstruct.mobheads.handlers.RenderPlayerHandler; 7 | import iguanaman.iguanatweakstconstruct.mobheads.renderers.IguanaTileEntitySkullRenderer; 8 | import iguanaman.iguanatweakstconstruct.mobheads.tileentities.IguanaSkullTileEntity; 9 | import net.minecraft.item.Item; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraftforge.common.MinecraftForge; 12 | 13 | public class MobHeadClientProxy extends MobHeadCommonProxy { 14 | @Override 15 | public void initialize() { 16 | ClientRegistry.bindTileEntitySpecialRenderer(IguanaSkullTileEntity.class, IguanaTileEntitySkullRenderer.renderer); 17 | } 18 | 19 | public void postInit() { 20 | // register the renderer 21 | MinecraftForge.EVENT_BUS.register(new RenderPlayerHandler()); 22 | 23 | if(Loader.isModLoaded("NotEnoughItems")) { 24 | codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 0)); 25 | codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 1)); 26 | codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 2)); 27 | codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 3)); 28 | 29 | codechicken.nei.api.API.hideItem(new ItemStack(Item.getItemFromBlock(IguanaMobHeads.skullBlock))); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/commands/CommandDumpOredict.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.commands; 2 | 3 | import iguanaman.iguanatweakstconstruct.util.Log; 4 | import net.minecraft.command.CommandBase; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.util.ChatComponentText; 7 | import net.minecraftforge.oredict.OreDictionary; 8 | 9 | import java.io.File; 10 | import java.io.FileNotFoundException; 11 | import java.io.PrintWriter; 12 | 13 | public class CommandDumpOredict extends CommandBase { 14 | 15 | @Override 16 | public String getCommandName() { 17 | return "dumpOredict"; 18 | } 19 | 20 | /** 21 | * Return the required permission level for this command. 22 | */ 23 | @Override 24 | public int getRequiredPermissionLevel() 25 | { 26 | return 2; 27 | } 28 | 29 | 30 | @Override 31 | public void processCommand(ICommandSender icommandsender, String[] astring) { 32 | File file = new File("dump_OreDict.txt"); 33 | try { 34 | PrintWriter pw = new PrintWriter(file); 35 | for(String ore : OreDictionary.getOreNames()) 36 | pw.println(ore); 37 | 38 | pw.close(); 39 | 40 | icommandsender.addChatMessage(new ChatComponentText("Dumped oredict names to " + file.getName())); 41 | } catch (FileNotFoundException e) { 42 | Log.error("Couldn't create file " + file.getName()); 43 | icommandsender.addChatMessage(new ChatComponentText("Couldn't create file " + file.getName())); 44 | } 45 | } 46 | 47 | 48 | @Override 49 | public String getCommandUsage(ICommandSender icommandsender) { 50 | return "/dumpOredict"; 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/reference/Reference.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.reference; 2 | 3 | import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; 4 | 5 | import java.io.File; 6 | 7 | public class Reference { 8 | public static final String MOD_ID = "IguanaTweaksTConstruct"; 9 | public static final String MOD_NAME = "Iguana Tinker Tweaks"; 10 | public static final String TCON_MOD_ID = "TConstruct"; 11 | 12 | public static final String RESOURCE = MOD_ID.toLowerCase(); 13 | 14 | public static final String PULSE_LEVELING = "ToolLeveling"; 15 | public static final String PULSE_HARVESTTWEAKS = "HarvestLevelTweaks"; 16 | public static final String PULSE_REPLACING = "ToolPartReplacing"; 17 | public static final String PULSE_MOBHEADS = "MobHeads"; 18 | public static final String PULSE_TWEAKS = "Tweaks"; 19 | public static final String PULSE_ITEMS = "Items"; 20 | public static final String PULSE_RESTRICTIONS = "Restrictions"; 21 | public static final String PULSE_WORLDGEN = "WorldGen"; 22 | public static final String PULSE_OVERRIDE = "Override"; 23 | 24 | public static final String PULSE_COMPAT_FMP = "MultipartCompat"; 25 | 26 | public static final String PROXY_CLIENT_CLASS = "iguanaman.iguanatweakstconstruct.proxy.ClientProxy"; 27 | public static final String PROXY_SERVER_CLASS = "iguanaman.iguanatweakstconstruct.proxy.ServerProxy"; 28 | 29 | public static String resource(String res) 30 | { 31 | return String.format("%s:%s", RESOURCE, res); 32 | } 33 | public static String prefix(String name) { return String.format("iguana.tcon.%s", name);} 34 | 35 | public static File configFile(String fileName) { return new File(IguanaTweaksTConstruct.configPath, fileName); } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/VanillaHoeNerfHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 5 | import iguanaman.iguanatweakstconstruct.tweaks.IguanaTweaks; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.item.ItemHoe; 8 | import net.minecraft.util.EnumChatFormatting; 9 | import net.minecraft.util.StatCollector; 10 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 11 | import net.minecraftforge.event.entity.player.UseHoeEvent; 12 | 13 | public class VanillaHoeNerfHandler { 14 | @SubscribeEvent 15 | public void onHoeBlock(UseHoeEvent event) 16 | { 17 | // don't modify hoeing without tool (from machines, if they even send an event.) 18 | if(event.current == null) 19 | return; 20 | 21 | if(isUselessHoe(event.current.getItem())) 22 | event.setCanceled(true); 23 | } 24 | 25 | @SubscribeEvent 26 | public void onItemToolTip(ItemTooltipEvent event) { 27 | if (event.entityPlayer == null) 28 | return; 29 | 30 | if(isUselessHoe(event.itemStack.getItem())) { 31 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessHoe1")); 32 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessTool2")); 33 | } 34 | } 35 | 36 | public static boolean isUselessHoe(Item item) 37 | { 38 | if(item == null) 39 | return false; 40 | 41 | if(IguanaTweaks.toolWhitelist.contains(item)) 42 | return false; 43 | 44 | if(item instanceof ItemHoe) 45 | return true; 46 | 47 | return false; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/SpecialChars.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | public class SpecialChars { 4 | 5 | public static String MCStyle = "\u00A7"; 6 | 7 | public static String BLACK = MCStyle + "0"; 8 | public static String DBLUE = MCStyle + "1"; 9 | public static String DGREEN = MCStyle + "2"; 10 | public static String DAQUA = MCStyle + "3"; 11 | public static String DRED = MCStyle + "4"; 12 | public static String DPURPLE = MCStyle + "5"; 13 | public static String GOLD = MCStyle + "6"; 14 | public static String GRAY = MCStyle + "7"; 15 | public static String DGRAY = MCStyle + "8"; 16 | public static String BLUE = MCStyle + "9"; 17 | public static String GREEN = MCStyle + "a"; 18 | public static String AQUA = MCStyle + "b"; 19 | public static String RED = MCStyle + "c"; 20 | public static String LPURPLE = MCStyle + "d"; 21 | public static String YELLOW = MCStyle + "e"; 22 | public static String WHITE = MCStyle + "f"; 23 | 24 | public static String OBF = MCStyle + "k"; 25 | public static String BOLD = MCStyle + "l"; 26 | public static String STRIKE = MCStyle + "m"; 27 | public static String UNDER = MCStyle + "n"; 28 | public static String ITALIC = MCStyle + "o"; 29 | public static String RESET = MCStyle + "r"; 30 | 31 | public static String WailaStyle = "\u00A4"; 32 | public static String WailaIcon = "\u00A5"; 33 | public static String TAB = WailaStyle + WailaStyle +"a"; 34 | public static String ALIGNRIGHT = WailaStyle + WailaStyle +"b"; 35 | public static String ALIGNCENTER = WailaStyle + WailaStyle +"c"; 36 | public static String HEART = WailaStyle + WailaIcon +"a"; 37 | public static String HHEART = WailaStyle + WailaIcon +"b"; 38 | public static String EHEART = WailaStyle + WailaIcon +"c"; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/override/ExtraHarvestLevelHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.override; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.init.Blocks; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraftforge.event.entity.player.PlayerEvent; 7 | 8 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 9 | 10 | // This class handles harvest levels on the same block but where some metadata requires a tool, 11 | // and some metadatas don't 12 | public class ExtraHarvestLevelHandler { 13 | @SubscribeEvent 14 | public void breakSpeed(PlayerEvent.BreakSpeed event) 15 | { 16 | if(event.entityPlayer == null) 17 | return; 18 | 19 | if(event.block == null || event.block == Blocks.air) 20 | return; 21 | 22 | Block block = event.block; 23 | int hlvl = event.block.getHarvestLevel(event.metadata); 24 | 25 | // does the block require a tool? 26 | if(hlvl <= 0) 27 | // no, nothing to do 28 | return; 29 | 30 | // tool requires a harvest level, but does the material require a tool? 31 | if(!block.getMaterial().isToolNotRequired()) 32 | // a tool is required, we don't have to do anything 33 | return; 34 | 35 | // The tool does NOT require a tool, but has a harvest level for a tool set 36 | // we now manually check if this requiremnet is fulfilled 37 | 38 | String tool = event.block.getHarvestTool(event.metadata); 39 | ItemStack itemStack = event.entityPlayer.getCurrentEquippedItem(); 40 | 41 | if(itemStack != null && itemStack.getItem() != null) { 42 | if(itemStack.getItem().getHarvestLevel(itemStack, tool) >= hlvl) 43 | // everything ok, correct tool 44 | return; 45 | } 46 | 47 | // we require a tool, but no fitting tool is present. we prevent any breaking 48 | event.setCanceled(true); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/modcompat/fmp/ClientFMPProxy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.modcompat.fmp; 2 | 3 | 4 | import codechicken.microblock.handler.MicroblockProxy$; 5 | import iguanaman.iguanatweakstconstruct.reference.Reference; 6 | import net.minecraft.item.Item; 7 | import net.minecraftforge.client.MinecraftForgeClient; 8 | 9 | public class ClientFMPProxy extends CommonFMPProxy { 10 | @Override 11 | public void updateSawRenderers() { 12 | Item stoneSaw = MicroblockProxy$.MODULE$.sawStone(); 13 | Item ironSaw = MicroblockProxy$.MODULE$.sawIron(); 14 | Item diamondSaw = MicroblockProxy$.MODULE$.sawDiamond(); 15 | 16 | if(MicroblockProxy$.MODULE$.useSawIcons()) { 17 | IguanaFMPCompat.arditeSaw.setTextureName(Reference.resource("sawArdite")); 18 | IguanaFMPCompat.cobaltSaw.setTextureName(Reference.resource("sawCobalt")); 19 | IguanaFMPCompat.manyullynSaw.setTextureName(Reference.resource("sawManyullyn")); 20 | } else { 21 | MinecraftForgeClient.registerItemRenderer(stoneSaw, new IguanaItemSawRenderer("microblock:textures/items/saw.png", 0)); 22 | MinecraftForgeClient.registerItemRenderer(ironSaw, new IguanaItemSawRenderer("microblock:textures/items/saw.png", 1)); 23 | MinecraftForgeClient.registerItemRenderer(diamondSaw, new IguanaItemSawRenderer("microblock:textures/items/saw.png", 2)); 24 | 25 | MinecraftForgeClient.registerItemRenderer(IguanaFMPCompat.arditeSaw, new IguanaItemSawRenderer(Reference.RESOURCE + ":textures/items/saw.png", 0)); 26 | MinecraftForgeClient.registerItemRenderer(IguanaFMPCompat.cobaltSaw, new IguanaItemSawRenderer(Reference.RESOURCE + ":textures/items/saw.png", 1)); 27 | MinecraftForgeClient.registerItemRenderer(IguanaFMPCompat.manyullynSaw, new IguanaItemSawRenderer(Reference.RESOURCE + ":textures/items/saw.png", 2)); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/handlers/RenderPlayerHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import cpw.mods.fml.relauncher.Side; 5 | import cpw.mods.fml.relauncher.SideOnly; 6 | import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; 7 | import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads; 8 | import iguanaman.iguanatweakstconstruct.mobheads.renderers.IguanaTileEntitySkullRenderer; 9 | import iguanaman.iguanatweakstconstruct.reference.Reference; 10 | import net.minecraft.item.Item; 11 | import net.minecraft.item.ItemStack; 12 | import net.minecraftforge.client.event.RenderPlayerEvent; 13 | import org.lwjgl.opengl.GL11; 14 | 15 | @SideOnly(Side.CLIENT) 16 | public class RenderPlayerHandler { 17 | @SubscribeEvent 18 | public void renderSkullHelmet(RenderPlayerEvent.SetArmorModel event) 19 | { 20 | ItemStack itemStack = event.entityPlayer.inventory.armorItemInSlot(3); 21 | if(itemStack == null) 22 | return; 23 | 24 | Item item = itemStack.getItem(); 25 | boolean isBucket = IguanaTweaksTConstruct.pulsar.isPulseLoaded(Reference.PULSE_ITEMS) && item == IguanaMobHeads.wearables; 26 | if(item != IguanaMobHeads.skullItem && !isBucket) 27 | return; 28 | 29 | GL11.glPushMatrix(); 30 | event.renderer.modelBipedMain.bipedHead.postRender(0.0625F); 31 | float f1 = 1.0625F; 32 | GL11.glScalef(f1, -f1, -f1); 33 | if(isBucket) 34 | IguanaTileEntitySkullRenderer.renderer.renderBucket(-0.5f, 0.0f, -0.5f, 180.0f, 1, itemStack.getItemDamage()); 35 | else 36 | IguanaTileEntitySkullRenderer.renderer.renderSkull(-0.5f, 0.0f, -0.5f, 180.0f, 1, itemStack.getItemDamage()); 37 | //TileEntitySkullRenderer.field_147536_b.func_152674_a(-0.5F, 0.0F, -0.5F, 1, 00.0F, 0, null); 38 | GL11.glPopMatrix(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/harvestlevels/VanillaToolTipHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.harvestlevels; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import iguanaman.iguanatweakstconstruct.leveling.LevelingTooltips; 5 | import iguanaman.iguanatweakstconstruct.reference.Config; 6 | import iguanaman.iguanatweakstconstruct.tweaks.handlers.VanillaHoeNerfHandler; 7 | import iguanaman.iguanatweakstconstruct.tweaks.handlers.VanillaToolNerfHandler; 8 | import net.minecraft.item.ItemTool; 9 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 10 | 11 | public class VanillaToolTipHandler { 12 | 13 | @SubscribeEvent 14 | public void onItemToolTip(ItemTooltipEvent event) { 15 | if (event.entityPlayer == null) 16 | return; 17 | 18 | if(!(event.itemStack.getItem() instanceof ItemTool)) 19 | return; 20 | 21 | if((Config.nerfVanillaTools && VanillaToolNerfHandler.isUselessTool(event.itemStack.getItem())) 22 | || (Config.nerfVanillaHoes && VanillaHoeNerfHandler.isUselessHoe(event.itemStack.getItem()))) 23 | return; 24 | 25 | // we're only interested in stuff that's basically a pickaxe 26 | int hlvl = event.itemStack.getItem().getHarvestLevel(event.itemStack, "pickaxe"); 27 | if (hlvl >= 0) 28 | event.toolTip.add(1, LevelingTooltips.getMiningLevelTooltip(hlvl)); 29 | 30 | // well.. let's check the other things too /o\ 31 | /* disabled because it'll probably cause more confusion than help.. 32 | hlvl = event.itemStack.getItem().getHarvestLevel(event.itemStack, "shovel"); 33 | if (hlvl >= 0) 34 | event.toolTip.add(1, LevelingTooltips.getMiningLevelTooltip(hlvl)); 35 | 36 | hlvl = event.itemStack.getItem().getHarvestLevel(event.itemStack, "axe"); 37 | if (hlvl >= 0) 38 | event.toolTip.add(1, LevelingTooltips.getMiningLevelTooltip(hlvl)); 39 | */ 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/VanillaToolNerfHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import iguanaman.iguanatweakstconstruct.tweaks.IguanaTweaks; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.ItemTool; 8 | import net.minecraft.util.EnumChatFormatting; 9 | import net.minecraft.util.StatCollector; 10 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 11 | import net.minecraftforge.event.entity.player.PlayerEvent; 12 | import net.minecraftforge.event.entity.player.UseHoeEvent; 13 | 14 | import java.util.Set; 15 | 16 | public class VanillaToolNerfHandler { 17 | @SubscribeEvent 18 | public void breakSpeed(PlayerEvent.BreakSpeed event) 19 | { 20 | if(event.entityPlayer == null) 21 | return; 22 | 23 | ItemStack itemStack = event.entityPlayer.getCurrentEquippedItem(); 24 | if(itemStack == null) 25 | return; 26 | 27 | if(isUselessTool(itemStack.getItem())) 28 | event.newSpeed = 0; 29 | } 30 | 31 | @SubscribeEvent 32 | public void onItemToolTip(ItemTooltipEvent event) { 33 | if (event.entityPlayer == null) 34 | return; 35 | 36 | if(isUselessTool(event.itemStack.getItem())) { 37 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessTool1")); 38 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessTool2")); 39 | } 40 | } 41 | 42 | public static boolean isUselessTool(Item item) 43 | { 44 | if(item == null) 45 | return false; 46 | 47 | if(IguanaTweaks.toolWhitelist.contains(item)) 48 | return false; 49 | 50 | if(item instanceof ItemTool) 51 | return true; 52 | 53 | return false; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/claybuckets/items/ClayBucketTinkerLiquids.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.claybuckets.items; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | import iguanaman.iguanatweakstconstruct.reference.Reference; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.client.renderer.texture.IIconRegister; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.init.Items; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.util.IIcon; 12 | import net.minecraft.util.MathHelper; 13 | import net.minecraft.world.World; 14 | import tconstruct.smeltery.items.FilledBucket; 15 | 16 | public class ClayBucketTinkerLiquids extends FilledBucket { 17 | public ClayBucketTinkerLiquids(Block b) { 18 | super(b); 19 | 20 | this.setUnlocalizedName(Reference.prefix("clayBucket")); 21 | this.setContainerItem(null); 22 | } 23 | 24 | @Override 25 | public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { 26 | ItemStack result = super.onItemRightClick(itemStack, world, player); 27 | 28 | if(result.getItem() == Items.bucket) 29 | { 30 | itemStack.stackSize--; 31 | return itemStack; 32 | } 33 | return result; 34 | } 35 | 36 | @Override 37 | @SideOnly(Side.CLIENT) 38 | public void registerIcons (IIconRegister iconRegister) 39 | { 40 | this.icons = new IIcon[textureNames.length]; 41 | 42 | for (int i = 0; i < this.icons.length; ++i) 43 | { 44 | this.icons[i] = iconRegister.registerIcon(Reference.resource("clayBucket_" + textureNames[i])); 45 | } 46 | } 47 | 48 | @Override 49 | public String getUnlocalizedName (ItemStack stack) 50 | { 51 | int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, materialNames.length); 52 | return getUnlocalizedName() + "." + materialNames[arr]; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import java.util.List; 4 | 5 | import net.minecraft.item.ItemStack; 6 | 7 | public interface IWailaDataProvider{ 8 | /* 9 | * Use this method to return an item stack in case the default lookup system fails. 10 | * Return null if you want to use the default lookup system. 11 | * You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities 12 | */ 13 | ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config); 14 | 15 | /* Waila HUD is divided into 3 zones. The head corresponds to the item name, 16 | * body to where you mostly want to put informations, and I reserve the tail for modname display 17 | */ 18 | 19 | /* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD. 20 | * You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack(). 21 | * ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info. 22 | * currenttip represents the current list of text lines in the tooltip zone. 23 | * For example, getWailaHead() will have the current item name as currenttip. 24 | * You can modify the tips, add more, remove some, etc. 25 | * When you are done, just returns the currenttip and it will display in Waila. 26 | * 27 | * Always return the currenttip is you don't want to modify the current zone. 28 | */ 29 | 30 | List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); 31 | List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); 32 | List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); 33 | } 34 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaBlock.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | import java.util.List; 4 | 5 | import net.minecraft.item.ItemStack; 6 | 7 | @Deprecated 8 | public interface IWailaBlock { 9 | /* 10 | * Use this method to return an item stack in case the default lookup system fails. 11 | * Return null if you want to use the default lookup system. 12 | * You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities 13 | */ 14 | ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config); 15 | 16 | /* Waila HUD is divided into 3 zones. The head corresponds to the item name, 17 | * body to where you mostly want to put informations, and I reserve the tail for modname display 18 | */ 19 | 20 | /* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD. 21 | * You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack(). 22 | * ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info. 23 | * currenttip represents the current list of text lines in the tooltip zone. 24 | * For example, getWailaHead() will have the current item name as currenttip. 25 | * You can modify the tips, add more, remove some, etc. 26 | * When you are done, just returns the currenttip and it will display in Waila. 27 | * 28 | * Always return the currenttip is you don't want to modify the current zone. 29 | */ 30 | 31 | List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); 32 | List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); 33 | List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); 34 | } 35 | -------------------------------------------------------------------------------- /src/api/java/cofh/api/energy/IEnergyContainerItem.java: -------------------------------------------------------------------------------- 1 | package cofh.api.energy; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * Implement this interface on Item classes that support external manipulation of their internal energy storages. 7 | * 8 | * A reference implementation is provided {@link ItemEnergyContainer}. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface IEnergyContainerItem 14 | { 15 | 16 | /** 17 | * Adds energy to an prefix. Returns the quantity of energy that was accepted. This should always return 0 if the prefix cannot be externally charged. 18 | * 19 | * @param container 20 | * ItemStack to be charged. 21 | * @param maxReceive 22 | * Maximum amount of energy to be sent into the prefix. 23 | * @param simulate 24 | * If TRUE, the charge will only be simulated. 25 | * @return Amount of energy that was (or would have been, if simulated) received by the prefix. 26 | */ 27 | int receiveEnergy (ItemStack container, int maxReceive, boolean simulate); 28 | 29 | /** 30 | * Removes energy from an prefix. Returns the quantity of energy that was removed. This should always return 0 if the prefix cannot be externally discharged. 31 | * 32 | * @param container 33 | * ItemStack to be discharged. 34 | * @param maxExtract 35 | * Maximum amount of energy to be extracted from the prefix. 36 | * @param simulate 37 | * If TRUE, the discharge will only be simulated. 38 | * @return Amount of energy that was (or would have been, if simulated) extracted from the prefix. 39 | */ 40 | int extractEnergy (ItemStack container, int maxExtract, boolean simulate); 41 | 42 | /** 43 | * Get the amount of energy currently stored in the prefix. 44 | */ 45 | int getEnergyStored (ItemStack container); 46 | 47 | /** 48 | * Get the max amount of energy that can be stored in the prefix. 49 | */ 50 | int getMaxEnergyStored (ItemStack container); 51 | 52 | } -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/VanillaBowNerfHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import iguanaman.iguanatweakstconstruct.leveling.handlers.LevelingToolTipHandler; 5 | import iguanaman.iguanatweakstconstruct.tweaks.IguanaTweaks; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.item.Item; 8 | import net.minecraft.item.ItemBow; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.item.ItemSword; 11 | import net.minecraft.util.EnumChatFormatting; 12 | import net.minecraft.util.StatCollector; 13 | import net.minecraftforge.event.entity.living.LivingHurtEvent; 14 | import net.minecraftforge.event.entity.player.ArrowNockEvent; 15 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 16 | 17 | import java.util.ListIterator; 18 | 19 | public class VanillaBowNerfHandler { 20 | @SubscribeEvent 21 | public void onArrowNock(ArrowNockEvent event) 22 | { 23 | if(event.entityPlayer == null) 24 | return; 25 | 26 | if(event.result == null) 27 | return; 28 | 29 | if(isUselessBow(event.result.getItem())) 30 | event.setCanceled(true); 31 | } 32 | 33 | @SubscribeEvent 34 | public void onItemToolTip(ItemTooltipEvent event) { 35 | if (event.entityPlayer == null) 36 | return; 37 | 38 | if(isUselessBow(event.itemStack.getItem())) { 39 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessBow1")); 40 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessTool2")); 41 | } 42 | } 43 | 44 | public static boolean isUselessBow(Item item) 45 | { 46 | if(item == null) 47 | return false; 48 | 49 | if(IguanaTweaks.toolWhitelist.contains(item)) 50 | return false; 51 | 52 | if(item instanceof ItemBow) 53 | return true; 54 | 55 | return false; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/leveling/modifiers/ModMiningLevelBoost.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.leveling.modifiers; 2 | 3 | import iguanaman.iguanatweakstconstruct.leveling.LevelingLogic; 4 | import iguanaman.iguanatweakstconstruct.reference.Config; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import net.minecraft.util.EnumChatFormatting; 8 | import tconstruct.modifiers.tools.ModBoolean; 9 | 10 | public class ModMiningLevelBoost extends ModBoolean { 11 | // the maximum mining level obtainable with this head 12 | private int maxLvl = 0; 13 | 14 | public ModMiningLevelBoost(ItemStack[] recipe, int effect, int maxLvl) { 15 | super(recipe, effect, "Mining Level Boost", EnumChatFormatting.GREEN.toString(), recipe[0].getDisplayName()); 16 | 17 | this.maxLvl = maxLvl; 18 | } 19 | 20 | @Override 21 | protected boolean canModify(ItemStack input, ItemStack[] recipe) { 22 | NBTTagCompound tags = input.getTagCompound().getCompoundTag("InfiTool"); 23 | 24 | // Modifier available? 25 | if(Config.mobHeadRequiresModifier && tags.getInteger("Modifiers") <= 0) 26 | return false; 27 | 28 | // already applied? 29 | if(tags.getBoolean(key)) 30 | return false; 31 | 32 | // got required harvest level? 33 | int hlvl = tags.getInteger("HarvestLevel"); 34 | if(hlvl < maxLvl && LevelingLogic.canBoostMiningLevel(tags)) 35 | return true; 36 | 37 | return false; 38 | } 39 | 40 | @Override 41 | public void modify(ItemStack[] input, ItemStack tool) { 42 | LevelingLogic.levelUpMiningLevel(tool, null, false); 43 | 44 | // add a modifier if it doesn't require one, because ModBoolean will substract one on modify 45 | if(!Config.mobHeadRequiresModifier) { 46 | NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); 47 | tags.setInteger("Modifiers", tags.getInteger("Modifiers") + 1); 48 | } 49 | 50 | super.modify(input, tool); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/restriction/IguanaPartRestriction.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.restriction; 2 | 3 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 4 | import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; 5 | import iguanaman.iguanatweakstconstruct.reference.Reference; 6 | import mantle.pulsar.pulse.Handler; 7 | import mantle.pulsar.pulse.Pulse; 8 | import net.minecraft.item.Item; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraftforge.common.MinecraftForge; 11 | import tconstruct.library.TConstructRegistry; 12 | import tconstruct.world.TinkerWorld; 13 | 14 | import java.io.File; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | @Pulse(id = Reference.PULSE_RESTRICTIONS, description = "Various Tweaks for vanilla Minecraft and Tinker's Construct. See Config.") 19 | public class IguanaPartRestriction { 20 | @Handler 21 | public void postInit(FMLPostInitializationEvent event) 22 | { 23 | // init the helper 24 | RestrictionHelper.init(); 25 | 26 | RestrictionConfig config = new RestrictionConfig(); 27 | config.init("restrictions.cfg"); 28 | 29 | adaptChestLoot(); 30 | 31 | MinecraftForge.EVENT_BUS.register(new PartRestrictionHandler()); 32 | } 33 | 34 | // removes all restricted parts from tinkerer chests in villages n stuff 35 | private void adaptChestLoot() 36 | { 37 | // this would be so much easier if i could just iterate over the contents. but we'll have to copy a few times 38 | // luckily this is only executed once on startup :) 39 | for(Map.Entry entry : TConstructRegistry.patternPartMapping.entrySet()) { 40 | Item pattern = (Item) entry.getKey().get(0); // the pattern 41 | Integer meta = (Integer) entry.getKey().get(1); // metadata of the pattern 42 | Integer matID = (Integer) entry.getKey().get(2); // Material-ID of the material needed to craft 43 | ItemStack part = (ItemStack) entry.getValue(); 44 | 45 | // remove if restricted 46 | if(RestrictionHelper.isRestricted(new ItemStack(pattern, 1, meta), TConstructRegistry.getMaterial(matID))) 47 | TinkerWorld.tinkerHouseChest.removeItem(part); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/replacing/PartToolTipHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.replacing; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import cpw.mods.fml.common.eventhandler.EventPriority; 5 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.util.EnumChatFormatting; 8 | import net.minecraft.util.StatCollector; 9 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 10 | import tconstruct.library.TConstructRegistry; 11 | import tconstruct.library.tools.ToolMaterial; 12 | import tconstruct.library.util.IToolPart; 13 | 14 | public class PartToolTipHandler { 15 | 16 | @SubscribeEvent(priority=EventPriority.LOW) 17 | public void onItemToolTip(ItemTooltipEvent event) { 18 | if(event.entityPlayer == null) 19 | return; 20 | 21 | // we're only interested if it's a tool part 22 | if(!(event.itemStack.getItem() instanceof IToolPart)) 23 | return; 24 | 25 | // we abuse the fact that the result is not used by anything else. 26 | // Some other tooltip handlers already added a different tooltip, so this part is not replaceable 27 | if(event.getResult() == Event.Result.DENY) 28 | return; 29 | 30 | ItemStack stack = event.itemStack; 31 | IToolPart part = (IToolPart)stack.getItem(); 32 | 33 | ToolMaterial mat = TConstructRegistry.getMaterial(part.getMaterialID(stack)); 34 | if(mat == null) 35 | return; 36 | 37 | String ability = mat.ability(); 38 | if(ability == null) 39 | return; 40 | // paper or thaumium? 41 | if(ability.equals(StatCollector.translateToLocal("materialtraits.writable")) || 42 | ability.equals(StatCollector.translateToLocal("materialtraits.thaumic"))) { 43 | event.toolTip.add(""); 44 | event.toolTip.add(EnumChatFormatting.RED + StatCollector.translateToLocal("tooltip.part.needsmodifier1")); 45 | event.toolTip.add(EnumChatFormatting.RED + StatCollector.translateToLocal("tooltip.part.needsmodifier2")); 46 | } 47 | else { 48 | event.toolTip.add(""); 49 | event.toolTip.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.part.replaceable")); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/leveling/modifiers/ModShoddy.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.leveling.modifiers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraft.util.EnumChatFormatting; 6 | import net.minecraft.util.StatCollector; 7 | import tconstruct.library.modifier.ItemModifier; 8 | import tconstruct.modifiers.tools.ModBoolean; 9 | 10 | // Shoddy handles Stonebound and Jagged. Jagged simply is negative Stonebound. 11 | public class ModShoddy extends ItemModifier { 12 | public static ModShoddy ModJagged = new ModShoddy("Jagged", EnumChatFormatting.RED.toString(), StatCollector.translateToLocal("materialtraits.jagged"), -0.7f); 13 | public static ModShoddy ModStonebound = new ModShoddy("Stonebound", EnumChatFormatting.AQUA.toString(), StatCollector.translateToLocal("materialtraits.stonebound"), 0.7f); 14 | 15 | protected float change; 16 | protected String color; 17 | protected String tooltipName; 18 | 19 | public ModShoddy(String tag, String c, String tip, float change) { 20 | super(new ItemStack[0], 0, tag); 21 | 22 | this.tooltipName = tip; 23 | this.color = c; 24 | this.change = change; 25 | } 26 | 27 | @Override 28 | protected boolean canModify(ItemStack tool, ItemStack[] input) { 29 | NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); 30 | 31 | // cannot apply jagged if we have stonebound 32 | if(tags.getFloat("Shoddy") > 0.0f && this.key.equals(ModJagged.key)) 33 | return false; 34 | 35 | // cannot apply stonebound if jagged 36 | if(tags.getFloat("Shoddy") < 0.0f && this.key.equals(ModStonebound.key)) 37 | return false; 38 | 39 | return true; 40 | } 41 | 42 | 43 | @Override 44 | public void modify(ItemStack[] input, ItemStack tool) { 45 | NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); 46 | 47 | if(!tags.getBoolean(key)) { 48 | tags.setBoolean(key, true); 49 | addToolTip(tool, color + tooltipName, color + key); 50 | } 51 | 52 | // go make stonebound/jagged...y 53 | tags.setFloat("Shoddy", tags.getFloat("Shoddy") + change); 54 | } 55 | 56 | // no visual effect :( 57 | @Override 58 | public void addMatchingEffect(ItemStack input) { 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/blocks/IguanaSkullBlock.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.blocks; 2 | 3 | import cpw.mods.fml.common.Optional; 4 | import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads; 5 | import iguanaman.iguanatweakstconstruct.mobheads.tileentities.IguanaSkullTileEntity; 6 | import iguanaman.iguanatweakstconstruct.reference.Reference; 7 | import net.minecraft.block.Block; 8 | import net.minecraft.block.BlockSkull; 9 | import net.minecraft.item.Item; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.tileentity.TileEntity; 12 | import net.minecraft.world.World; 13 | import thaumcraft.api.crafting.IInfusionStabiliser; 14 | 15 | import java.util.ArrayList; 16 | import java.util.Random; 17 | 18 | @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser") 19 | public class IguanaSkullBlock extends BlockSkull implements IInfusionStabiliser { 20 | 21 | public IguanaSkullBlock() { 22 | super(); 23 | 24 | this.setHardness(1.0F); 25 | this.setStepSound(Block.soundTypePiston); 26 | this.setBlockName(Reference.prefix("skull")); 27 | this.setBlockTextureName("skull"); 28 | } 29 | 30 | /** 31 | * Returns a new instance of a block's tile entity class. Called on placing the block. 32 | */ 33 | @Override 34 | public TileEntity createNewTileEntity(World world, int metadata) 35 | { 36 | return new IguanaSkullTileEntity(); 37 | } 38 | 39 | @Override 40 | public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { 41 | return IguanaMobHeads.skullItem; 42 | } 43 | 44 | @Override 45 | public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { 46 | return IguanaMobHeads.skullItem; 47 | } 48 | 49 | @Override 50 | public ArrayList getDrops(World world, int x, int y, int z, int noidea, int fortune) { 51 | ArrayList ret = new ArrayList(); 52 | if(world.getTileEntity(x,y,z) == null) 53 | return ret; 54 | 55 | ret.add(new ItemStack(IguanaMobHeads.skullItem, 1, this.getDamageValue(world, x,y,z))); 56 | return ret; 57 | } 58 | 59 | @Optional.Method(modid = "Thaumcraft") 60 | @Override 61 | public boolean canStabaliseInfusion(World world, int x, int y, int z) { 62 | return true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/models/ModelEnderManHead.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.models; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | import net.minecraft.client.model.ModelBase; 6 | import net.minecraft.client.model.ModelRenderer; 7 | import net.minecraft.entity.Entity; 8 | 9 | @SideOnly(Side.CLIENT) 10 | public class ModelEnderManHead extends ModelBase { 11 | 12 | public ModelRenderer endermanHead; 13 | public ModelRenderer endermanJaw; 14 | 15 | public ModelEnderManHead() 16 | { 17 | this.textureWidth = 64; 18 | this.textureHeight = 32; 19 | this.endermanHead = new ModelRenderer(this, 0, 0); 20 | this.endermanHead.addBox(-4.0F, -10.0F, -4.0F, 8, 8, 8, 0.0F); 21 | this.endermanHead.setRotationPoint(0.0F, 0.0F, 0.0F); 22 | this.endermanJaw = new ModelRenderer(this, 0, 16); 23 | this.endermanJaw.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.3F); 24 | this.endermanJaw.setRotationPoint(0.0F, 0.0F, 0.0F); 25 | } 26 | 27 | /** 28 | * Sets the models various rotation angles then renders the model. 29 | */ 30 | public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) 31 | { 32 | this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); 33 | this.endermanHead.render(p_78088_7_); 34 | this.endermanJaw.render(p_78088_7_); 35 | } 36 | 37 | /** 38 | * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms 39 | * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how 40 | * "far" arms and legs can swing at most. 41 | */ 42 | public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) 43 | { 44 | super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); 45 | this.endermanHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); 46 | this.endermanHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); 47 | 48 | this.endermanJaw.rotateAngleX = this.endermanHead.rotateAngleX; 49 | this.endermanJaw.rotateAngleY = this.endermanHead.rotateAngleY; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java: -------------------------------------------------------------------------------- 1 | package mcp.mobius.waila.api; 2 | 3 | public interface IWailaRegistrar { 4 | /* Add a config option in the section modname with displayed text configtext and access key keyname */ 5 | public void addConfig(String modname, String keyname, String configtext); 6 | public void addConfigRemote(String modname, String keyname, String configtext); 7 | public void addConfig(String modname, String keyname); 8 | public void addConfigRemote(String modname, String keyname); 9 | 10 | /* Register a stack overrider for the given blockID */ 11 | public void registerStackProvider(IWailaDataProvider dataProvider, Class block); 12 | 13 | /* Same thing, but works on a class hierarchy instead */ 14 | public void registerHeadProvider (IWailaDataProvider dataProvider, Class block); 15 | public void registerBodyProvider (IWailaDataProvider dataProvider, Class block); 16 | public void registerTailProvider (IWailaDataProvider dataProvider, Class block); 17 | 18 | /* Entity text registration methods */ 19 | public void registerHeadProvider (IWailaEntityProvider dataProvider, Class entity); 20 | public void registerBodyProvider (IWailaEntityProvider dataProvider, Class entity); 21 | public void registerTailProvider (IWailaEntityProvider dataProvider, Class entity); 22 | public void registerOverrideEntityProvider (IWailaEntityProvider dataProvider, Class entity); 23 | 24 | /* FMP Providers */ 25 | public void registerHeadProvider(IWailaFMPProvider dataProvider, String name); 26 | public void registerBodyProvider(IWailaFMPProvider dataProvider, String name); 27 | public void registerTailProvider(IWailaFMPProvider dataProvider, String name); 28 | 29 | /* The block decorators */ 30 | public void registerDecorator (IWailaBlockDecorator decorator, Class block); 31 | public void registerDecorator (IWailaFMPDecorator decorator, String name); 32 | 33 | /* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent). 34 | * Accept * as a ending wildcard 35 | * registerNBTKey("bob.*", MyBlock.class) 36 | * registerNBTKey("data.life", MyEntity.class) 37 | * registerNBTKey("*", MyTileEntity.class) will reproduce the full tag syncing from 1.4.5 38 | * */ 39 | public void registerSyncedNBTKey(String key, Class target); 40 | 41 | /* UNUSED FOR NOW (Will be used for the ingame wiki */ 42 | public void registerDocTextFile (String filename); 43 | public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/ToolUpdateRecipe.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct; 2 | 3 | import iguanaman.iguanatweakstconstruct.reference.Reference; 4 | import net.minecraft.inventory.InventoryCrafting; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.item.crafting.IRecipe; 7 | import net.minecraft.world.World; 8 | import net.minecraftforge.oredict.RecipeSorter; 9 | import tconstruct.library.tools.ToolCore; 10 | 11 | public class ToolUpdateRecipe implements IRecipe { 12 | static { 13 | // register the recipe with the recipesorter 14 | RecipeSorter.register(Reference.MOD_ID + ":update", ToolUpdateRecipe.class, RecipeSorter.Category.SHAPELESS, ""); 15 | } 16 | 17 | private ItemStack updatedTool = null; 18 | 19 | @Override 20 | public boolean matches(InventoryCrafting inventoryCrafting, World world) { 21 | ItemStack tool = null; 22 | 23 | // check for a tool 24 | for(int i = 0; i < inventoryCrafting.getSizeInventory(); i++) 25 | { 26 | ItemStack slot = inventoryCrafting.getStackInSlot(i); 27 | // empty slot 28 | if(slot == null) 29 | continue; 30 | 31 | // is it the tool? 32 | if(slot.getItem() instanceof ToolCore) { 33 | if(tool != null) 34 | return false; 35 | tool = slot; 36 | } 37 | } 38 | // no tool found? 39 | if(tool == null) 40 | return false; 41 | 42 | // check if it needs updating 43 | if(OldToolConversionHandler.toolNeedsUpdating(tool)) 44 | { 45 | updatedTool = tool.copy(); 46 | OldToolConversionHandler.updateItem(updatedTool); 47 | return true; 48 | } 49 | else 50 | updatedTool = null; 51 | 52 | return false; 53 | } 54 | 55 | @Override 56 | public ItemStack getCraftingResult(InventoryCrafting inventory) { 57 | // we call the matches-function again to sync up the issue in case it got called between 58 | // the matches-call and the getCraftingResult call 59 | // we can pass null for the world since it is never accessed in the function 60 | matches(inventory, null); 61 | 62 | return updatedTool; 63 | } 64 | 65 | @Override 66 | public int getRecipeSize() { 67 | return 1; 68 | } 69 | 70 | @Override 71 | public ItemStack getRecipeOutput() { 72 | return updatedTool; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/harvestlevels/modifiers/ModBonusMiningLevel.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.harvestlevels.modifiers; 2 | 3 | import iguanaman.iguanatweakstconstruct.leveling.LevelingLogic; 4 | import iguanaman.iguanatweakstconstruct.reference.Config; 5 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.nbt.NBTTagCompound; 8 | import net.minecraft.util.EnumChatFormatting; 9 | import tconstruct.library.modifier.ItemModifier; 10 | import tconstruct.modifiers.tools.ModBoolean; 11 | import tconstruct.modifiers.tools.ModDurability; 12 | 13 | import java.util.logging.Level; 14 | 15 | public class ModBonusMiningLevel extends ItemModifier { 16 | public final String parentTag; 17 | 18 | public ModBonusMiningLevel(ItemStack[] recipe, String parentTag) { 19 | super(recipe, 0, "GemBoost"); 20 | 21 | this.parentTag = parentTag; 22 | } 23 | 24 | @Override 25 | protected boolean canModify(ItemStack input, ItemStack[] recipe) { 26 | NBTTagCompound tags = input.getTagCompound().getCompoundTag("InfiTool"); 27 | 28 | // only on bronze harvest level 29 | if(LevelingLogic.getHarvestLevel(tags) != HarvestLevels._4_bronze) 30 | return false; 31 | 32 | // already applied? (actually impossible, but maybe we'll change something in the future 33 | if (tags.getBoolean(key)) 34 | return false; 35 | 36 | // can be applied without modifier if diamond/emerald modifier is already present 37 | if(tags.getInteger("Modifiers") <= 0 && !tags.getBoolean(parentTag)) 38 | return false; 39 | 40 | // only if harvestlevel is bronze and can NOT be boosted anymore 41 | return !LevelingLogic.canBoostMiningLevel(tags); 42 | } 43 | 44 | @Override 45 | public void modify(ItemStack[] input, ItemStack tool) { 46 | NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); 47 | // set harvestlevel to diamond 48 | tags.setInteger("HarvestLevel", HarvestLevels._5_diamond); 49 | 50 | // no need to remove a modifier, since we either already have a diamond modifier or get it added together with this modifier 51 | // but we have to add the key 52 | tags.setBoolean(key, true); 53 | } 54 | 55 | @Override 56 | public void addMatchingEffect(ItemStack input) { 57 | // we don't add an effect, because the diamond/emerald modifier that'll be applied with this will 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/leveling/handlers/MobHeadTooltipHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.leveling.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import iguanaman.iguanatweakstconstruct.mobheads.items.IguanaSkull; 5 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 6 | import net.minecraft.init.Items; 7 | import net.minecraft.item.ItemSkull; 8 | import net.minecraft.util.EnumChatFormatting; 9 | import net.minecraft.util.StatCollector; 10 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 11 | 12 | /** 13 | * Displays the tooltips on mob heads for the mob-head modifier. 14 | */ 15 | public class MobHeadTooltipHandler { 16 | @SubscribeEvent 17 | public void onItemToolTip(ItemTooltipEvent event) { 18 | if (event.entityPlayer == null) 19 | return; 20 | 21 | int mlvl = -1; 22 | int meta = event.itemStack.getItemDamage(); 23 | // iguana mobheads 24 | if (event.itemStack.getItem() instanceof IguanaSkull) { 25 | switch(meta) 26 | { 27 | // pigman zombie 28 | case 1: mlvl = HarvestLevels._5_diamond; break; 29 | // blaze 30 | case 2: mlvl = HarvestLevels._6_obsidian; break; 31 | // blizz 32 | case 3: mlvl = HarvestLevels._6_obsidian; break; 33 | // enderman 34 | case 0: mlvl = HarvestLevels._7_ardite; break; 35 | } 36 | } 37 | // vanilla mobheads 38 | else if(event.itemStack.getItem() instanceof ItemSkull) { 39 | switch(meta) 40 | { 41 | // zombie 42 | case 2: mlvl = HarvestLevels._2_copper; break; 43 | // skelly 44 | case 0: mlvl = HarvestLevels._3_iron; break; 45 | // creeper 46 | case 4: mlvl = HarvestLevels._5_diamond; break; 47 | // witherskelly 48 | case 1: mlvl = HarvestLevels._8_cobalt; break; 49 | } 50 | } 51 | // netherstar 52 | else if(event.itemStack.getItem() == Items.nether_star) 53 | mlvl = HarvestLevels._9_manyullym; 54 | 55 | if(mlvl > 0) { 56 | // we reduce the mining level by 1 because they're applicable UP TO that level, not including it. :) 57 | mlvl--; 58 | event.toolTip.add(EnumChatFormatting.GOLD + StatCollector.translateToLocalFormatted("tooltip.mobhead.level", HarvestLevels.getHarvestLevelName(mlvl))); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/claybuckets/items/ClayBucket.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.claybuckets.items; 2 | 3 | import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; 4 | import iguanaman.iguanatweakstconstruct.claybuckets.IguanaItems; 5 | import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads; 6 | import iguanaman.iguanatweakstconstruct.reference.Reference; 7 | import net.minecraft.block.Block; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.init.Blocks; 10 | import net.minecraft.init.Items; 11 | import net.minecraft.item.ItemBucket; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.world.World; 14 | 15 | public class ClayBucket extends ItemBucket 16 | { 17 | private final boolean isHot; 18 | 19 | public ClayBucket(Block contents, String name, String texture) 20 | { 21 | this(contents); 22 | 23 | this.setUnlocalizedName(Reference.prefix(name)); 24 | this.setTextureName(Reference.resource(texture)); 25 | } 26 | 27 | public ClayBucket(Block contents) 28 | { 29 | super(contents); 30 | 31 | if(contents == Blocks.flowing_lava) 32 | { 33 | isHot = true; 34 | this.setContainerItem(null); 35 | } 36 | else { 37 | isHot = false; 38 | this.setContainerItem(IguanaItems.clayBucketFired); 39 | } 40 | } 41 | 42 | 43 | @Override 44 | public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { 45 | ItemStack result = super.onItemRightClick(itemStack, world, player); 46 | 47 | if(result.getItem() == Items.bucket) { 48 | // bucket is destroyed if it's a hot fluid 49 | if(isHot) 50 | { 51 | itemStack.stackSize--; 52 | 53 | // very very rarely, you'll get a broken bucket! 54 | if(IguanaTweaksTConstruct.pulsar.isPulseLoaded(Reference.PULSE_MOBHEADS) && itemStack.stackSize == 0 && IguanaTweaksTConstruct.random.nextInt(1000) == 0) 55 | return new ItemStack(IguanaMobHeads.wearables, 1, 1); 56 | 57 | return itemStack; 58 | } 59 | 60 | return new ItemStack(IguanaItems.clayBucketFired); 61 | } 62 | // water/lava pickup is handled in the ClayBucketHandler 63 | //if(result.getItem() == Items.water_bucket) return new ItemStack(IguanaItems.clayBucketWater); 64 | //if(result.getItem() == Items.lava_bucket) return new ItemStack(IguanaItems.clayBucketLava); 65 | return result; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/commands/CommandDumpTools.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.commands; 2 | 3 | import cpw.mods.fml.common.registry.GameRegistry; 4 | import iguanaman.iguanatweakstconstruct.util.Log; 5 | import net.minecraft.command.CommandBase; 6 | import net.minecraft.command.ICommandSender; 7 | import net.minecraft.init.Items; 8 | import net.minecraft.item.*; 9 | import net.minecraft.util.ChatComponentText; 10 | import net.minecraftforge.oredict.OreDictionary; 11 | 12 | import java.io.File; 13 | import java.io.FileNotFoundException; 14 | import java.io.PrintWriter; 15 | import java.util.Collections; 16 | import java.util.Iterator; 17 | import java.util.LinkedList; 18 | import java.util.List; 19 | 20 | public class CommandDumpTools extends CommandBase { 21 | @Override 22 | public String getCommandName() { 23 | return "dumpTools"; 24 | } 25 | 26 | @Override 27 | public String getCommandUsage(ICommandSender iCommandSender) { 28 | return "/dumpTools"; 29 | } 30 | 31 | @Override 32 | public void processCommand(ICommandSender icommandsender, String[] input) { 33 | File file = new File("dump_Tools.txt"); 34 | try { 35 | PrintWriter pw = new PrintWriter(file); 36 | // we sort the names, otherwise it's quite hard to find something in the list 37 | List itemnames = new LinkedList(Item.itemRegistry.getKeys()); 38 | Collections.sort(itemnames); 39 | // iterate through all registered item keys (their names) 40 | for(Object key : itemnames) 41 | { 42 | // get the object for the key 43 | Object item = Item.itemRegistry.getObject(key); 44 | // if the object is a tool, we dump it 45 | if(item instanceof ItemTool || item instanceof ItemHoe || item instanceof ItemSword || item instanceof ItemBow) 46 | pw.println(key.toString()); 47 | // if it's not one of these, but still has a toolclass, we consider it tool. 48 | //else if(item instanceof Item) 49 | // if(!((Item) item).getToolClasses(null).isEmpty()) 50 | // pw.println(key.toString()); 51 | } 52 | 53 | pw.close(); 54 | 55 | icommandsender.addChatMessage(new ChatComponentText("Dumped tool names to " + file.getName())); 56 | } catch (FileNotFoundException e) { 57 | Log.error("Couldn't create file " + file.getName()); 58 | icommandsender.addChatMessage(new ChatComponentText("Couldn't create file " + file.getName())); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/override/IguanaOverride.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.override; 2 | 3 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 4 | import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; 5 | import iguanaman.iguanatweakstconstruct.reference.Reference; 6 | import iguanaman.iguanatweakstconstruct.util.Log; 7 | import mantle.pulsar.pulse.Handler; 8 | import mantle.pulsar.pulse.Pulse; 9 | import tconstruct.util.IMCHandler; 10 | 11 | import net.minecraftforge.common.ForgeHooks; 12 | import net.minecraftforge.common.MinecraftForge; 13 | import net.minecraftforge.common.config.Configuration; 14 | 15 | import java.io.File; 16 | 17 | /** 18 | * Allows to override: 19 | * - All material properties 20 | * - Mining Levels of all tools 21 | * - Harvest Levels of all oredict Entries 22 | * - Harvest Levels of all blocks (overrides oredict) 23 | */ 24 | @Pulse(id = Reference.PULSE_OVERRIDE, description = "This module allows to override about any values relevant for TConstruct or IguanaTinkerTweaks.", defaultEnable = false) 25 | public class IguanaOverride { 26 | 27 | @Handler 28 | public void postInit(FMLPostInitializationEvent event) 29 | { 30 | new ForgeHooks(); 31 | doOverride("Material", new MaterialOverride()); 32 | doOverride("Tool", new ToolOverride()); 33 | doOverride("Block", new BlockOverride()); 34 | doOverride("BonusModifier", new ModifierOverride()); 35 | doOverride("HarvestLevelNames", new HarvestLevelNameOverride()); 36 | 37 | MinecraftForge.EVENT_BUS.register(new ExtraHarvestLevelHandler()); 38 | } 39 | 40 | public static void doOverride(String type, IOverride overrider) 41 | { 42 | String configFileName = type + "Override.cfg"; 43 | String defaultFileName = type + "Defaults.cfg"; 44 | 45 | try { 46 | Configuration defaultConfig = new Configuration(Reference.configFile(defaultFileName)); 47 | overrider.createDefault(defaultConfig); 48 | defaultConfig.save(); 49 | } catch(RuntimeException e) { 50 | IMCHandler.bigWarning("An Error occurred while creating default files for the %s Override", type); 51 | Log.error(e); 52 | } 53 | 54 | try { 55 | Configuration config = new Configuration(Reference.configFile(configFileName)); 56 | config.load(); 57 | overrider.processConfig(config); 58 | 59 | if(config.hasChanged()) 60 | config.save(); 61 | } catch(RuntimeException e) { 62 | IMCHandler.bigWarning("An Error occurred while processing the Override for %s", type); 63 | Log.error(e); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/leveling/modifiers/ModXpAwareRedstone.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.leveling.modifiers; 2 | 3 | import iguanaman.iguanatweakstconstruct.leveling.LevelingLogic; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import tconstruct.modifiers.tools.ModRedstone; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * The same as the redstone modifier, but translates current XP on modifying. 12 | * Basically: You get XP when applying it, because the required XP for the next level also increases. XP% stays the same. 13 | */ 14 | public class ModXpAwareRedstone extends ModRedstone { 15 | public final ModRedstone originalModifier; 16 | 17 | public ModXpAwareRedstone(ModRedstone modifier) { 18 | super(modifier.effectIndex, ListStackToStackArray(modifier.stacks), ListIntToIntArray(modifier.increase)); 19 | originalModifier = modifier; 20 | } 21 | 22 | @Override 23 | public void modify(ItemStack[] input, ItemStack tool) { 24 | NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); 25 | // get max xp before modifying 26 | long oldXP = LevelingLogic.getRequiredXp(tool, tags); 27 | long oldBoostXP = LevelingLogic.getRequiredBoostXp(tool); 28 | // modify 29 | super.modify(input, tool); 30 | 31 | // update regular xp 32 | if(LevelingLogic.hasXp(tags)) { 33 | long newXP = LevelingLogic.getRequiredXp(tool, tags); 34 | float xp = LevelingLogic.getXp(tags); 35 | xp *= (float) newXP / (float) oldXP; 36 | tags.setLong(LevelingLogic.TAG_EXP, Math.round(xp)); 37 | } 38 | 39 | // update boost xp 40 | if(LevelingLogic.hasBoostXp(tags)) 41 | { 42 | long newBoostXP = LevelingLogic.getRequiredBoostXp(tool); 43 | float xp = LevelingLogic.getBoostXp(tags); 44 | xp *= (float) newBoostXP / (float) oldBoostXP; 45 | tags.setLong(LevelingLogic.TAG_BOOST_EXP, Math.round(xp)); 46 | } 47 | } 48 | 49 | // we need this because the constructor expects an int[] array, although it uses Integer internally, and Integer[] can't be casted to int[]... 50 | static int[] ListIntToIntArray(List list) 51 | { 52 | int[] arr = new int[list.size()]; 53 | for(int i = 0; i < list.size(); i++) 54 | arr[i] = list.get(i); 55 | 56 | return arr; 57 | } 58 | 59 | static ItemStack[] ListStackToStackArray(List list) 60 | { 61 | ItemStack[] arr = new ItemStack[list.size()]; 62 | for(int i = 0; i < list.size(); i++) 63 | arr[i] = list.get(i); 64 | 65 | return arr; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/VanillaSwordNerfHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import iguanaman.iguanatweakstconstruct.leveling.handlers.LevelingToolTipHandler; 5 | import iguanaman.iguanatweakstconstruct.tweaks.IguanaTweaks; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.item.Item; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.item.ItemSword; 10 | import net.minecraft.item.ItemTool; 11 | import net.minecraft.util.EnumChatFormatting; 12 | import net.minecraft.util.StatCollector; 13 | import net.minecraftforge.common.util.FakePlayer; 14 | import net.minecraftforge.event.entity.living.LivingHurtEvent; 15 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 16 | import net.minecraftforge.event.entity.player.PlayerEvent; 17 | 18 | import java.util.ListIterator; 19 | 20 | public class VanillaSwordNerfHandler { 21 | @SubscribeEvent 22 | public void onHurt(LivingHurtEvent event) 23 | { 24 | if (!(event.source.damageType.equals("player"))) 25 | return; 26 | 27 | // only players 28 | if (!(event.source.getEntity() instanceof EntityPlayer)) 29 | return; 30 | EntityPlayer player = (EntityPlayer) event.source.getEntity(); 31 | 32 | // the tool 33 | ItemStack stack = player.getCurrentEquippedItem(); 34 | if(stack == null) 35 | return; 36 | 37 | if(isUselessWeapon(stack.getItem())) 38 | event.setCanceled(true); 39 | } 40 | 41 | @SubscribeEvent 42 | public void onItemToolTip(ItemTooltipEvent event) { 43 | if (event.entityPlayer == null) 44 | return; 45 | 46 | if(isUselessWeapon(event.itemStack.getItem())) { 47 | // remove +dmg stuff 48 | ListIterator iter = event.toolTip.listIterator(); 49 | while(iter.hasNext()) 50 | { 51 | if(iter.next().startsWith(LevelingToolTipHandler.plusPrefix)) 52 | iter.remove(); 53 | } 54 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessWeapon1")); 55 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.uselessTool2")); 56 | } 57 | } 58 | 59 | public static boolean isUselessWeapon(Item item) 60 | { 61 | if(item == null) 62 | return false; 63 | 64 | if(IguanaTweaks.toolWhitelist.contains(item)) 65 | return false; 66 | 67 | if(item instanceof ItemSword) 68 | return true; 69 | 70 | return false; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/api/resources/TConstruct_at.cfg: -------------------------------------------------------------------------------- 1 | # Tinkers Construct -- Access Transformer 2 | # Required for any build system. 3 | # Last update: Minecraft 1.7.2 - 2014 Feb 02 by Progwml6 4 | # EntityArrow - Grabbed 'em all, since so much is accessed 5 | public net.minecraft.entity.projectile.EntityArrow field_145789_f 6 | public net.minecraft.entity.projectile.EntityArrow field_145790_g 7 | public net.minecraft.entity.projectile.EntityArrow field_145791_d 8 | public net.minecraft.entity.projectile.EntityArrow field_145792_e 9 | public net.minecraft.entity.projectile.EntityArrow field_70254_i 10 | public net.minecraft.entity.projectile.EntityArrow field_70252_j 11 | public net.minecraft.entity.projectile.EntityArrow field_70253_h 12 | public net.minecraft.entity.projectile.EntityArrow field_70257_an 13 | public net.minecraft.entity.projectile.EntityArrow field_70255_ao 14 | public net.minecraft.entity.projectile.EntityArrow field_70256_ap 15 | public net.minecraft.entity.projectile.EntityArrow *() #we need waaaaaaay to much in here to bother going through it 16 | # RenderGlobal 17 | public net.minecraft.client.renderer.RenderGlobal field_147592_B 18 | # Blocks 19 | public-f net.minecraft.block.Block field_149764_J 20 | public net.minecraft.block.BlockLeavesBase field_150121_P 21 | public net.minecraft.block.BlockRailBase$Rail func_150650_a()I 22 | # GuiContainer 23 | public net.minecraft.client.gui.inventory.GuiContainer field_146999_f 24 | public net.minecraft.client.gui.inventory.GuiContainer field_147009_r 25 | public net.minecraft.client.gui.inventory.GuiContainer field_147003_i 26 | public net.minecraft.client.gui.inventory.GuiContainer func_146977_a(Lnet/minecraft/inventory/Slot;)V #renderSlot 27 | public net.minecraft.client.gui.inventory.GuiContainer func_146981_a(Lnet/minecraft/inventory/Slot;II)Z #isMouseOverSlot 28 | # GuiScreen 29 | public net.minecraft.client.gui.GuiScreen field_146292_n #buttonList 30 | # ThreadDownloadImageData 31 | public net.minecraft.client.renderer.ThreadDownloadImageData field_110559_g #field_110559_g 32 | public net.minecraft.client.renderer.ThreadDownloadImageData field_110560_d #field_110560_d 33 | public net.minecraft.world.gen.structure.StructureVillagePieces$Village #cant make village houses w/o this 34 | public net.minecraft.client.renderer.Tessellator field_78415_z 35 | public net.minecraft.client.renderer.entity.RenderPlayer field_77109_a #modelBipedMain 36 | # PlayerControllerMP and ItemInWorldManager for blockbreaking 37 | public net.minecraft.client.multiplayer.PlayerControllerMP func_85182_a(III)Z #sameToolAndBlock 38 | public net.minecraft.server.management.ItemInWorldManager field_73086_f 39 | public net.minecraft.server.management.ItemInWorldManager field_73087_g 40 | public net.minecraft.server.management.ItemInWorldManager field_73099_h 41 | # needs to have a space at the end of every line or SS will derp 42 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/PartCraftingRecipe.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks; 2 | 3 | import iguanaman.iguanatweakstconstruct.reference.Reference; 4 | import net.minecraft.inventory.InventoryCrafting; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.item.crafting.IRecipe; 7 | import net.minecraft.world.World; 8 | import net.minecraftforge.oredict.RecipeSorter; 9 | import tconstruct.library.TConstructRegistry; 10 | import tconstruct.library.crafting.PatternBuilder; 11 | import tconstruct.library.tools.ToolCore; 12 | import tconstruct.library.util.IPattern; 13 | import tconstruct.tools.items.Pattern; 14 | 15 | public class PartCraftingRecipe implements IRecipe { 16 | static { 17 | // register the recipe with the recipesorter 18 | RecipeSorter.register(Reference.MOD_ID + ":part", RepairCraftingRecipe.class, RecipeSorter.Category.SHAPELESS, ""); 19 | } 20 | 21 | private ItemStack outputPart; 22 | 23 | @Override 24 | public boolean matches(InventoryCrafting inventoryCrafting, World world) { 25 | outputPart = null; 26 | ItemStack pattern = null; 27 | ItemStack input = null; 28 | 29 | for(int i = 0; i < inventoryCrafting.getSizeInventory(); i++) 30 | { 31 | ItemStack slot = inventoryCrafting.getStackInSlot(i); 32 | // empty slot 33 | if(slot == null) 34 | continue; 35 | 36 | // is it the tool? 37 | if(slot.getItem() instanceof IPattern) { 38 | // only one pattern 39 | if(pattern != null) 40 | return false; 41 | 42 | pattern = slot; 43 | // otherwise.. input material 44 | } 45 | else { 46 | if(input != null) 47 | return false; 48 | 49 | input = slot; 50 | } 51 | } 52 | 53 | if(pattern == null || input == null) 54 | return false; 55 | 56 | // make sure it's a valid pattern 57 | if(!PatternBuilder.instance.toolPatterns.contains(pattern.getItem())) 58 | return false; 59 | 60 | ItemStack[] output = PatternBuilder.instance.getToolPart(input, pattern, null); 61 | if(output == null) 62 | return false; 63 | 64 | for(ItemStack stack : output) 65 | if(stack != null) { 66 | outputPart = stack; 67 | return true; 68 | } 69 | 70 | return false; 71 | } 72 | 73 | @Override 74 | public ItemStack getCraftingResult(InventoryCrafting inventory) { 75 | return outputPart; 76 | } 77 | 78 | @Override 79 | public int getRecipeSize() { 80 | return 2; 81 | } 82 | 83 | @Override 84 | public ItemStack getRecipeOutput() { 85 | return outputPart; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/api/java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java: -------------------------------------------------------------------------------- 1 | package powercrystals.minefactoryreloaded.api; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | import java.util.Random; 6 | 7 | import net.minecraft.block.Block; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.world.World; 10 | 11 | /** 12 | * @author PowerCrystals 13 | * 14 | * Defines a harvestable block for the Harvester. 15 | */ 16 | public interface IFactoryHarvestable 17 | { 18 | /** 19 | * @return The block this harvestable instance is managing. 20 | */ 21 | public Block getPlant(); 22 | 23 | /** 24 | * @return The type of harvest the Harvester should perform on this block. 25 | */ 26 | public HarvestType getHarvestType(); 27 | 28 | /** 29 | * @return Whether or not the Harvester should break the block when harvesting. If false, no changes will be performed by the Harvester itself. 30 | */ 31 | public boolean breakBlock(); 32 | 33 | /** 34 | * @param world The world this block is in. 35 | * @param harvesterSettings The harvester's current settings. Do not modify these. 36 | * @param x The X coordinate of the block being harvested. 37 | * @param y The Y coordinate of the block being harvested. 38 | * @param z The Z coordinate of the block being harvested. 39 | * @return True if this block can be harvested. 40 | */ 41 | public boolean canBeHarvested(World world, Map harvesterSettings, int x, int y, int z); 42 | 43 | /** 44 | * @param world The world this block is in. 45 | * @param rand A Random instance to use when generating drops. 46 | * @param harvesterSettings The harvester's current settings. Do not modify these. 47 | * @param x The X coordinate of the block being harvested. 48 | * @param y The Y coordinate of the block being harvested. 49 | * @param z The Z coordinate of the block being harvested. 50 | * @return The drops generated by breaking this block. For a default implementation, calling Block.getBlockDropped() is usually sufficient. 51 | */ 52 | public List getDrops(World world, Random rand, Map harvesterSettings, int x, int y, int z); 53 | 54 | /** 55 | * Called before the block is going to be harvested. Usually empty. 56 | * @param world The world this block is in. 57 | * @param x The X coordinate of the block being harvested. 58 | * @param y The Y coordinate of the block being harvested. 59 | * @param z The Z coordinate of the block being harvested. 60 | */ 61 | public void preHarvest(World world, int x, int y, int z); 62 | 63 | /** 64 | * Called after the block is going to be harvested. Used to re-till soil, for example. 65 | * @param world The world this block is in. 66 | * @param x The X coordinate of the block being harvested. 67 | * @param y The Y coordinate of the block being harvested. 68 | * @param z The Z coordinate of the block being harvested. 69 | */ 70 | public void postHarvest(World world, int x, int y, int z); 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/items/Wearable.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.items; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads; 6 | import iguanaman.iguanatweakstconstruct.reference.Reference; 7 | import net.minecraft.client.renderer.texture.IIconRegister; 8 | import net.minecraft.creativetab.CreativeTabs; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.EntityPlayer; 11 | import net.minecraft.item.Item; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.util.EnumChatFormatting; 14 | import net.minecraft.util.IIcon; 15 | import net.minecraft.util.StatCollector; 16 | 17 | import java.util.List; 18 | 19 | public class Wearable extends Item { 20 | private static final String[] textureTypes = new String[] {"bucketHoley", "clayBucketCracked", "endermanJaw", "bathat"}; 21 | private IIcon[] icons; 22 | 23 | public Wearable() { 24 | super(); 25 | this.setContainerItem(IguanaMobHeads.wearables); 26 | this.setUnlocalizedName(Reference.prefix("wearable")); 27 | 28 | this.setMaxStackSize(1); 29 | } 30 | 31 | @Override 32 | public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { 33 | return armorType == 0; // 0 = helmet 34 | } 35 | 36 | @SuppressWarnings("unchecked") 37 | @Override 38 | public void addInformation(ItemStack item, EntityPlayer player, List tooltips, boolean advanced) { 39 | // specul tooltips 40 | tooltips.add(EnumChatFormatting.DARK_GRAY + StatCollector.translateToLocal("tooltip." + textureTypes[item.getItemDamage()])); 41 | } 42 | 43 | @Override 44 | public String getUnlocalizedName(ItemStack par1ItemStack) 45 | { 46 | int i = par1ItemStack.getItemDamage(); 47 | 48 | if (i < 0 || i >= textureTypes.length) 49 | i = 0; 50 | 51 | return getUnlocalizedName() + "." + textureTypes[i]; 52 | } 53 | 54 | @Override 55 | @SideOnly(Side.CLIENT) 56 | @SuppressWarnings({ "unchecked", "rawtypes" }) 57 | public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) 58 | { 59 | for (int j = 0; j < textureTypes.length; ++j) 60 | par3List.add(new ItemStack(par1, 1, j)); 61 | } 62 | 63 | @Override 64 | @SideOnly(Side.CLIENT) 65 | public void registerIcons(IIconRegister par1IconRegister) 66 | { 67 | icons = new IIcon[textureTypes.length]; 68 | 69 | for (int i = 0; i < textureTypes.length; ++i) 70 | icons[i] = par1IconRegister.registerIcon(Reference.resource(textureTypes[i])); 71 | } 72 | 73 | @Override 74 | @SideOnly(Side.CLIENT) 75 | public IIcon getIconFromDamage(int par1) 76 | { 77 | if (par1 < 0 || par1 >= textureTypes.length) 78 | par1 = 0; 79 | 80 | return icons[par1]; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/modcompat/fmp/IguanaItemSawRenderer.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.modcompat.fmp; 2 | 3 | import codechicken.lib.render.CCModel; 4 | import codechicken.lib.render.CCRenderState; 5 | import codechicken.lib.render.uv.UVTranslation; 6 | import codechicken.lib.vec.*; 7 | import codechicken.microblock.ItemSawRenderer; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.util.ResourceLocation; 10 | import net.minecraftforge.client.IItemRenderer; 11 | import org.lwjgl.opengl.GL11; 12 | 13 | import java.util.Map; 14 | 15 | public class IguanaItemSawRenderer implements IItemRenderer { 16 | private static Map models = CCModel.parseObjModels(new ResourceLocation("microblock", "models/saw.obj"), 7, new SwapYZ()); 17 | private static CCModel handle = models.get("Handle"); 18 | private static CCModel holder = models.get("BladeSupport"); 19 | private static CCModel blade = models.get("Blade"); 20 | 21 | private final String texture; 22 | private final int uvIndex; 23 | 24 | public IguanaItemSawRenderer(String texture, int uvIndex) { 25 | this.texture = texture; 26 | this.uvIndex = uvIndex; 27 | } 28 | 29 | @Override 30 | public boolean handleRenderType(ItemStack item, ItemRenderType type) { 31 | return true; 32 | } 33 | 34 | @Override 35 | public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { 36 | return true; 37 | } 38 | 39 | @Override 40 | public void renderItem(ItemRenderType type, ItemStack item, Object... data) { 41 | TransformationList t; 42 | switch(type) { 43 | case INVENTORY: t = new TransformationList(new Scale(1.8), new Translation(0, 0, -0.6), new Rotation(-Math.PI/4d, 1, 0, 0), new Rotation(Math.PI*3d/4, 0, 1, 0)); break; 44 | case ENTITY: t = new TransformationList(new Scale(1), new Translation(0, 0, -0.25), new Rotation(-Math.PI/4d, 1, 0, 0)); break; 45 | case EQUIPPED_FIRST_PERSON: t = new TransformationList(new Scale(1.5), new Rotation(-Math.PI/3d, 1, 0, 0), new Rotation(Math.PI*3d/4, 0, 1, 0), new Translation(0.5, 0.5, 0.5)); break; 46 | case EQUIPPED: t = new TransformationList(new Scale(1.5), new Rotation(-Math.PI/5d, 1, 0, 0), new Rotation(-Math.PI*3d/4, 0, 1, 0), new Translation(0.75, 0.5, 0.75)); break; 47 | default: return; 48 | } 49 | 50 | CCRenderState.reset(); 51 | CCRenderState.useNormals = true; 52 | CCRenderState.pullLightmap(); 53 | CCRenderState.changeTexture(texture); 54 | CCRenderState.startDrawing(); 55 | handle.render(t); 56 | holder.render(t); 57 | CCRenderState.draw(); 58 | GL11.glDisable(GL11.GL_CULL_FACE); 59 | CCRenderState.startDrawing(); 60 | blade.render(t, new UVTranslation(0, uvIndex*4/64D)); 61 | CCRenderState.draw(); 62 | GL11.glEnable(GL11.GL_CULL_FACE); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/RepairCraftingRecipe.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks; 2 | 3 | import iguanaman.iguanatweakstconstruct.reference.Reference; 4 | import net.minecraft.inventory.InventoryCrafting; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.item.crafting.IRecipe; 7 | import net.minecraft.world.World; 8 | import net.minecraftforge.oredict.RecipeSorter; 9 | import tconstruct.library.crafting.ModifyBuilder; 10 | import tconstruct.library.modifier.ItemModifier; 11 | import tconstruct.library.tools.ToolCore; 12 | import tconstruct.modifiers.tools.ModToolRepair; 13 | 14 | public class RepairCraftingRecipe implements IRecipe { 15 | static { 16 | // register the recipe with the recipesorter 17 | RecipeSorter.register(Reference.MOD_ID + ":repair", RepairCraftingRecipe.class, RecipeSorter.Category.SHAPELESS, ""); 18 | } 19 | 20 | private ModToolRepair modifier = null; 21 | private ItemStack modifiedTool = null; 22 | 23 | public RepairCraftingRecipe() { 24 | for(ItemModifier mod : ModifyBuilder.instance.itemModifiers) 25 | if(mod instanceof ModToolRepair) { 26 | modifier = (ModToolRepair)mod; 27 | break; 28 | } 29 | } 30 | 31 | @Override 32 | public boolean matches(InventoryCrafting inventoryCrafting, World world) { 33 | ItemStack tool = null; 34 | ItemStack[] input = new ItemStack[inventoryCrafting.getSizeInventory()]; 35 | 36 | for(int i = 0; i < inventoryCrafting.getSizeInventory(); i++) 37 | { 38 | ItemStack slot = inventoryCrafting.getStackInSlot(i); 39 | // empty slot 40 | if(slot == null) 41 | continue; 42 | 43 | // is it the tool? 44 | if(slot.getItem() instanceof ToolCore) 45 | tool = slot; 46 | // otherwise.. input material 47 | else 48 | input[i] = slot; 49 | } 50 | // no tool found? 51 | if(tool == null) 52 | return false; 53 | 54 | // check if applicable, and save result for later 55 | if(modifier.matches(input, tool)) { 56 | modifiedTool = tool.copy(); 57 | modifier.modify(input, modifiedTool); 58 | return true; 59 | } 60 | else 61 | modifiedTool = null; 62 | 63 | return false; 64 | } 65 | 66 | @Override 67 | public ItemStack getCraftingResult(InventoryCrafting inventoryCrafting) { 68 | // we call the matches-function again to sync up the issue in case it got called between 69 | // the matches-call and the getCraftingResult call 70 | // we can pass null for the world since it is never accessed in the function 71 | matches(inventoryCrafting, null); 72 | return modifiedTool; 73 | } 74 | 75 | @Override 76 | public int getRecipeSize() { 77 | return 2; 78 | } 79 | 80 | @Override 81 | public ItemStack getRecipeOutput() { 82 | return modifiedTool; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/commands/CommandIAmADirtyCheater.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.commands; 2 | 3 | import net.minecraft.command.CommandBase; 4 | import net.minecraft.command.ICommandSender; 5 | import net.minecraft.entity.player.EntityPlayerMP; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.ChatComponentText; 9 | import net.minecraft.util.EnumChatFormatting; 10 | import net.minecraft.util.StatCollector; 11 | 12 | import java.util.Arrays; 13 | 14 | import iguanaman.iguanatweakstconstruct.leveling.IguanaToolLeveling; 15 | 16 | public class CommandIAmADirtyCheater extends CommandBase { 17 | 18 | @Override 19 | public String getCommandName() { 20 | return "imadirtycheater"; 21 | } 22 | 23 | @Override 24 | public String getCommandUsage(ICommandSender p_71518_1_) { 25 | if(isCheater(p_71518_1_)) { 26 | return "I heard you like chicken"; 27 | } 28 | else { 29 | return "Why are you saying that you're a dirty cheater?"; 30 | } 31 | } 32 | 33 | @Override 34 | public int getRequiredPermissionLevel() { 35 | return 0; 36 | } 37 | 38 | @Override 39 | public void processCommand(ICommandSender sender, String[] args) { 40 | if(!isCheater(sender)) { 41 | sender.addChatMessage(new ChatComponentText(EnumChatFormatting.ITALIC + "You don't look like a cheater to me")); 42 | } else { 43 | String cmd = getCommandName(); 44 | String arg = StatCollector.translateToLocal("message.apology"); 45 | 46 | StringBuilder sb = new StringBuilder(); 47 | for(String s : args) { 48 | sb.append(s); 49 | sb.append(" "); 50 | } 51 | 52 | if(arg.toLowerCase().trim().equals(sb.toString().toLowerCase().trim())) { 53 | sender.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.apologyaccepted"))); 54 | convertTool(sender, getCurrentItem(sender)); 55 | } else { 56 | sender.addChatMessage( 57 | new ChatComponentText(EnumChatFormatting.ITALIC + "If you're really sorry, type:")); 58 | sender.addChatMessage(new ChatComponentText("/" + cmd + " " + arg)); 59 | } 60 | } 61 | } 62 | 63 | public ItemStack getCurrentItem(ICommandSender sender) { 64 | EntityPlayerMP player = getCommandSenderAsPlayer(sender); 65 | 66 | return player.getCurrentEquippedItem(); 67 | } 68 | 69 | public boolean isCheater(ICommandSender sender) { 70 | ItemStack stack = getCurrentItem(sender); 71 | return stack != null && stack.getItem() == IguanaToolLeveling.rubberChicken; 72 | } 73 | 74 | private void convertTool(ICommandSender sender, ItemStack stack) { 75 | if(stack.getItem() != IguanaToolLeveling.rubberChicken) 76 | return; 77 | 78 | if(!stack.hasTagCompound() || !stack.getTagCompound().getCompoundTag("InfiTool").hasKey("Original")) 79 | return; 80 | 81 | 82 | 83 | String unloc = stack.getTagCompound().getCompoundTag("InfiTool").getString("Original"); 84 | Item.itemRegistry.containsKey(unloc); 85 | Item item = getItemByText(sender, unloc); 86 | if(item == null) 87 | return; 88 | 89 | stack.func_150996_a(item); 90 | stack.getTagCompound().getCompoundTag("InfiTool").setInteger("CheatyXP", 0); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/handlers/StoneToolHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 5 | import cpw.mods.fml.common.eventhandler.EventPriority; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.util.EnumChatFormatting; 8 | import net.minecraft.util.StatCollector; 9 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 10 | import tconstruct.library.TConstructRegistry; 11 | import tconstruct.library.event.ToolCraftEvent; 12 | import tconstruct.library.tools.ToolMaterial; 13 | import tconstruct.library.util.IToolPart; 14 | import tconstruct.tools.TinkerTools; 15 | import tconstruct.weaponry.TinkerWeaponry; 16 | import tconstruct.weaponry.ammo.ArrowAmmo; 17 | import tconstruct.weaponry.ammo.BoltAmmo; 18 | import tconstruct.weaponry.weapons.Crossbow; 19 | import tconstruct.weaponry.weapons.LongBow; 20 | import tconstruct.weaponry.weapons.ShortBow; 21 | 22 | public class StoneToolHandler { 23 | // we can initialize this statically, because it wont be initialized until PostInit, where all materials are already registered 24 | private static ToolMaterial stoneMaterial = TConstructRegistry.getMaterial("Stone"); 25 | 26 | @SubscribeEvent(priority=EventPriority.HIGHEST) 27 | public void onTooltip(ItemTooltipEvent event) 28 | { 29 | if(event.entityPlayer == null) 30 | return; 31 | 32 | // we're only interested if it's a tool part 33 | if(!(event.itemStack.getItem() instanceof IToolPart) || event.itemStack.getItem() == TinkerWeaponry.bowstring || event.itemStack.getItem() == TinkerWeaponry.fletching || event.itemStack.getItem() == TinkerWeaponry.partArrowShaft) 34 | return; 35 | 36 | ItemStack stack = event.itemStack; 37 | IToolPart part = (IToolPart)stack.getItem(); 38 | 39 | // stone parts disabled? 40 | if(TConstructRegistry.getMaterial(part.getMaterialID(stack)) == stoneMaterial) 41 | { 42 | event.toolTip.add(1, ""); 43 | event.toolTip.add(2, EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.part.castonly1")); 44 | event.toolTip.add(3, EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.part.castonly2")); 45 | // we abuse the fact that the result is not used by anything to signal our other handlers to not add another tooltip 46 | event.setResult(Event.Result.DENY); 47 | } 48 | } 49 | 50 | @SubscribeEvent 51 | public void onToolCraft(ToolCraftEvent event) 52 | { 53 | for(int i = 0; i < event.materials.length; i++) 54 | { 55 | // ignore bowstring and fletchings 56 | if(event.tool instanceof ShortBow && i == 1) 57 | continue; 58 | if(event.tool instanceof LongBow && i == 1) 59 | continue; 60 | if(event.tool instanceof Crossbow && i == 2) 61 | continue; 62 | if(event.tool instanceof ArrowAmmo && i >= 1) 63 | continue; 64 | if(event.tool instanceof BoltAmmo && i == 2) 65 | continue; 66 | 67 | // don't allow stone tools 68 | if(event.materials[i] == stoneMaterial) 69 | event.setResult(Event.Result.DENY); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/IguanaMobHeads.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads; 2 | 3 | import cpw.mods.fml.common.SidedProxy; 4 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 5 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 6 | import cpw.mods.fml.common.registry.GameRegistry; 7 | import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; 8 | import iguanaman.iguanatweakstconstruct.mobheads.blocks.IguanaSkullBlock; 9 | import iguanaman.iguanatweakstconstruct.mobheads.handlers.MobHeadHandler; 10 | import iguanaman.iguanatweakstconstruct.mobheads.handlers.RenderPlayerHandler; 11 | import iguanaman.iguanatweakstconstruct.mobheads.items.IguanaSkull; 12 | import iguanaman.iguanatweakstconstruct.mobheads.items.Wearable; 13 | import iguanaman.iguanatweakstconstruct.mobheads.proxy.MobHeadCommonProxy; 14 | import iguanaman.iguanatweakstconstruct.mobheads.tileentities.IguanaSkullTileEntity; 15 | import iguanaman.iguanatweakstconstruct.reference.Reference; 16 | import iguanaman.iguanatweakstconstruct.util.Log; 17 | import iguanaman.iguanatweakstconstruct.util.ModSupportHelper; 18 | import mantle.pulsar.pulse.Handler; 19 | import mantle.pulsar.pulse.Pulse; 20 | import net.minecraft.block.Block; 21 | import net.minecraft.item.Item; 22 | import net.minecraft.item.ItemStack; 23 | import net.minecraft.util.WeightedRandomChestContent; 24 | import net.minecraftforge.common.ChestGenHooks; 25 | import net.minecraftforge.common.MinecraftForge; 26 | 27 | /** 28 | * Adds additional MobHeads and controls MobHead dropping. 29 | */ 30 | @Pulse(id = Reference.PULSE_MOBHEADS, description = "Adds additional MobHeads and control over MobHead drops.") 31 | public class IguanaMobHeads { 32 | public static Item skullItem; 33 | public static Block skullBlock; 34 | public static Item wearables; // secret thing 35 | 36 | @SidedProxy(clientSide = "iguanaman.iguanatweakstconstruct.mobheads.proxy.MobHeadClientProxy", serverSide = "iguanaman.iguanatweakstconstruct.mobheads.proxy.MobHeadCommonProxy") 37 | public static MobHeadCommonProxy proxy; 38 | 39 | @Handler 40 | public void preInit(FMLPreInitializationEvent event) 41 | { 42 | proxy.initialize(); 43 | 44 | if(ModSupportHelper.ThermalFoundation) 45 | integrateThermalExpansion(); 46 | 47 | skullItem = new IguanaSkull(); 48 | GameRegistry.registerItem(skullItem, "skullItem"); 49 | 50 | skullBlock = new IguanaSkullBlock(); 51 | GameRegistry.registerBlock(skullBlock, "skullBlock"); 52 | GameRegistry.registerTileEntity(IguanaSkullTileEntity.class, "skullTE"); 53 | 54 | // psssssst! 55 | wearables = new Wearable(); 56 | GameRegistry.registerItem(wearables, "wearableBucket"); 57 | } 58 | 59 | @Handler 60 | public void postInit(FMLPostInitializationEvent event) 61 | { 62 | MinecraftForge.EVENT_BUS.register(new MobHeadHandler()); 63 | 64 | proxy.postInit(); 65 | 66 | // :> 67 | ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(new ItemStack(wearables, 1, 0), 0, 1, 1)); 68 | ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new ItemStack(wearables, 1, 3), 0, 1, 1)); 69 | } 70 | 71 | private void integrateThermalExpansion() 72 | { 73 | Log.debug("Adding Blizz head"); 74 | IguanaSkull.addHead(3, "blizz", "skull_blizz"); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Original_extratic_materials.txt: -------------------------------------------------------------------------------- 1 | // Base ores 2 | updateMaterial(_4_bronze, "Hepatizon", 300, 800, 3, 1.2f); // Bronze + Gold, higher handle modifier? 3 | updateMaterial(_4_bronze, "Damascus Steel", 500, 600, 4, 1.3f); // Bronze + Iron 4 | updateMaterial(_4_bronze, "Angmallen", 300, 800, 3, 1.0f); // Iron + Gold 5 | 6 | // Fantasy ores 7 | updateMaterial(_0_stone, "Prometheum", 200, 400, 2, 1.0f); 8 | updateMaterial(_1_flint, "Deep Iron", 250, 600, 3, 1.3f); 9 | updateMaterial(_2_copper, "Black Steel", 500, 800, 3, 1.3f); // infuscolium (hlvl2) + deep iron 10 | updateMaterial(_3_iron, "Oureclase", 750, 800, 3, 1.3f); 11 | updateMaterial(_4_bronze, "Astral Silver", 35, 1200, 2, 0.35f); 12 | updateMaterial(_5_diamond, "Carmot", 50, 1200, 2, 0.35f); 13 | updateMaterial(_5_diamond, "Mithril", 1000, 900, 4, 1.5f); 14 | updateMaterial(_5_diamond, "Quicksilver", 1100, 1400, 4, 1.8f); // Mithril + Silver 15 | updateMaterial(_6_obsidian, "Haderoth", 1250, 1200, 4, 2.3f); // Rubracium (hlvl7) + Mithril 16 | updateMaterial(_7_ardite, "Orichalcum", 1350, 900, 4, 2.5f); 17 | updateMaterial(_8_cobalt, "Celengil", 1600, 1400, 4, 2.5f); // Orichalcum + Platin 18 | updateMaterial(_8_cobalt, "Adamantine", 1550, 100, 5, 2.75f); 19 | updateMaterial(_8_cobalt, "Atlarus", 1750, 1000, 5, 2.5f); 20 | updateMaterial(_9_manyullym, "Tartarite", 3000, 1400, 6, 3.0f); // Adamantine + Atlarus 21 | 22 | // nether ores 23 | updateMaterial(_4_bronze, "Ignatius", 200, 400, 3, 1.0f); 24 | updateMaterial(_4_bronze, "Shadow Iron", 300, 400, 3, 1.3f); 25 | updateMaterial(_4_bronze, "Shadow Steel", 400, 600, 4, 1.3f); // Shadom Iron + Lemurite 26 | updateMaterial(_5_diamond, "Midasium", 100, 1000, 4, 1.0f); 27 | updateMaterial(_5_diamond, "Vyroxeres", 300, 700, 4, 1.3f); 28 | updateMaterial(_6_obsidian, "Ceruclase", 500, 700, 4, 1.4f); 29 | updateMaterial(_6_obsidian, "Inolashite", 900, 800, 4, 1.7f); // Alduorite + Ceruclase 30 | updateMaterial(_6_obsidian, "Kalendrite", 1000, 800, 4, 1.75f); 31 | updateMaterial(_6_obsidian, "Amordrine", 1300, 1400, 4, 1.8f); // Kalendrite + Platinum 32 | updateMaterial(_7_ardite, "Vulcanite", 1500, 1000, 4, 2.0f); 33 | updateMaterial(_8_cobalt, "Sanguinite", 1750, 1200, 5, 2.3f); 34 | 35 | // end ores 36 | updateMaterial(_5_diamond, "Eximite", 1000, 800, 4, 1.3f); 37 | updateMaterial(_6_obsidian, "Desichalkos", 1800, 1000, 5, 2.75f); // Eximite + Meutoite 38 | 39 | // precious 40 | updateMaterial(_2_copper, "Brass", 15, 1200, 2, 0.2f); // Copper + Zinc 41 | updateMaterial(_3_iron, "Silver", 25, 1600, 2, 0.2f); 42 | updateMaterial(_4_bronze, "Electrum", 100, 2000, 2, 0.75f); // Silver + Gold 43 | updateMaterial(_6_obsidian, "Platinum", 100, 2400, 2, 0.75f); 44 | 45 | // Natura 46 | updateMaterial(_1_flint, "Ghostwood", 131, 400, 1, 1.3f); 47 | updateMaterial(_2_copper, "Darkwood", 131, 400, 1, 1.7f); 48 | updateMaterial(_3_iron, "Fusewood", 250, 600, 2, 1.4f); 49 | updateMaterial(_4_bronze, "Bloodwood", 350, 700, 3, 1.5f); 50 | 51 | // Extratic stuff 52 | updateMaterial(_1_flint, "Nether Quartz", 101, 300, 1, 0.7f); 53 | updateMaterial(_7_ardite, "Fairy", 250, 750, 2, 1.2f); // ardite + obsidian + blood 54 | updateMaterial(_8_cobalt, "Pokefennium", 500, 850, 2, 1.5f); // cobalt + iron + blood 55 | 56 | // Applied Energistics 2 57 | updateMaterial(_3_iron, "Certus Quartz", 250, 600, 2, 1.4f); 58 | 59 | // Biomes o' Plenty 60 | updateMaterial(_5_diamond, "Amethyst", 1548, 1500, 5, 1.2f); 61 | 62 | // Mekanism 63 | updateMaterial(_3_iron, "Refined Glowstone", 300, 1400, 5, 1.75f); 64 | updateMaterial(_6_obsidian, "Osmium", 500, 1000, 4, 1.3f); -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/leveling/commands/IguanaCommandToolXP.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.leveling.commands; 2 | 3 | import iguanaman.iguanatweakstconstruct.leveling.LevelingLogic; 4 | import net.minecraft.command.CommandBase; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.command.WrongUsageException; 7 | import net.minecraft.entity.player.EntityPlayerMP; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.nbt.NBTTagCompound; 10 | import tconstruct.library.TConstructRegistry; 11 | import tconstruct.library.tools.ToolCore; 12 | 13 | public class IguanaCommandToolXP extends CommandBase { 14 | 15 | @Override 16 | public String getCommandName() { 17 | return "toolxp"; 18 | } 19 | 20 | /** 21 | * Return the required permission level for this command. 22 | */ 23 | @Override 24 | public int getRequiredPermissionLevel() 25 | { 26 | return 2; 27 | } 28 | 29 | @Override 30 | public void processCommand(ICommandSender icommandsender, String[] astring) { 31 | if (astring.length > 0) 32 | { 33 | EntityPlayerMP entityplayermp = astring.length >= 2 ? getPlayer(icommandsender, astring[0]) : getCommandSenderAsPlayer(icommandsender); 34 | int xp = astring.length >= 2 ? parseIntWithMinMax(icommandsender, astring[1], 0, Integer.MAX_VALUE) : parseIntWithMinMax(icommandsender, astring[0], 0, Integer.MAX_VALUE); 35 | ItemStack equipped = entityplayermp.getCurrentEquippedItem(); 36 | if (equipped != null && equipped.getItem() instanceof ToolCore) 37 | { 38 | NBTTagCompound tags = equipped.getTagCompound().getCompoundTag("InfiTool"); 39 | if (tags.hasKey("ToolLevel")) 40 | { 41 | int level = tags.getInteger("ToolLevel"); 42 | int hLevel = tags.hasKey("HarvestLevel") ? hLevel = tags.getInteger("HarvestLevel") : -1; 43 | 44 | if (level >= 1 && level <= 5 || hLevel >= TConstructRegistry.getMaterial("Copper").harvestLevel() || hLevel < TConstructRegistry.getMaterial("Manyullyn").harvestLevel()) 45 | { 46 | Long toolXP = tags.hasKey("ToolEXP") ? tags.getLong("ToolEXP") : -1; 47 | Long headXP = tags.hasKey("HeadEXP") ? tags.getLong("HeadEXP") : -1; 48 | 49 | LevelingLogic.updateXP(equipped, entityplayermp, toolXP + xp, headXP + xp); 50 | 51 | if (entityplayermp != icommandsender) 52 | { 53 | // TODO: find replacement for notifyAdmins 54 | // possibly RConConsoleSource? 55 | //notifyAdmins(icommandsender, 1, "Added " + xp + " to %s's tool", new Object[]{entityplayermp.getEntityName()}); 56 | } 57 | else 58 | { 59 | // TODO: find replacement for notifyAdmins 60 | //notifyAdmins(icommandsender, 1, "Added " + xp + " to their own tool", new Object[]{}); 61 | } 62 | } else 63 | throw new WrongUsageException("Players tool is already max level", new Object[0]); 64 | } else 65 | throw new WrongUsageException("Player must have a levelable Tinker's Construct tool in hand", new Object[0]); 66 | } else 67 | throw new WrongUsageException("Player must have a Tinker's Construct tool in hand", new Object[0]); 68 | } else 69 | throw new WrongUsageException("toolxp [player] ", new Object[0]); 70 | } 71 | 72 | 73 | /** 74 | * Parses an int from the given sring with a specified minimum. 75 | */ 76 | public static int parseIntWithMinMax(ICommandSender par0ICommandSender, String par1Str, int min, int max) 77 | { 78 | return parseIntBounded(par0ICommandSender, par1Str, min, max); 79 | } 80 | 81 | @Override 82 | public String getCommandUsage(ICommandSender icommandsender) { 83 | return null; 84 | } 85 | 86 | @Override 87 | public int compareTo (Object o) 88 | { 89 | // TODO Auto-generated method stub 90 | return 0; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/leveling/commands/IguanaCommandLevelUpTool.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.leveling.commands; 2 | 3 | import iguanaman.iguanatweakstconstruct.leveling.LevelingLogic; 4 | import net.minecraft.command.CommandBase; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.command.WrongUsageException; 7 | import net.minecraft.entity.player.EntityPlayerMP; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.nbt.NBTTagCompound; 10 | import tconstruct.library.TConstructRegistry; 11 | import tconstruct.library.tools.ToolCore; 12 | 13 | public class IguanaCommandLevelUpTool extends CommandBase { 14 | 15 | @Override 16 | public String getCommandName() { 17 | return "leveluptool"; 18 | } 19 | 20 | /** 21 | * Return the required permission level for this command. 22 | */ 23 | @Override 24 | public int getRequiredPermissionLevel() 25 | { 26 | return 2; 27 | } 28 | 29 | @Override 30 | public void processCommand(ICommandSender icommandsender, String[] astring) { 31 | EntityPlayerMP entityplayermp = astring.length >= 1 ? getPlayer(icommandsender, astring[0]) : getCommandSenderAsPlayer(icommandsender); 32 | ItemStack equipped = entityplayermp.getCurrentEquippedItem(); 33 | if (equipped != null && equipped.getItem() instanceof ToolCore) 34 | { 35 | NBTTagCompound tags = equipped.getTagCompound().getCompoundTag("InfiTool"); 36 | if (tags.hasKey("ToolLevel")) 37 | { 38 | int level = tags.getInteger("ToolLevel"); 39 | int hLevel = tags.hasKey("HarvestLevel") ? hLevel = tags.getInteger("HarvestLevel") : -1; 40 | 41 | if (level >= 1 && level <= 5 || hLevel >= TConstructRegistry.getMaterial("Copper").harvestLevel() || hLevel < TConstructRegistry.getMaterial("Manyullyn").harvestLevel()) 42 | { 43 | Long toolXP = tags.hasKey("ToolEXP") ? tags.getLong("ToolEXP") : -1; 44 | Long headXP = tags.hasKey("HeadEXP") ? tags.getLong("HeadEXP") : -1; 45 | long requiredToolXP = LevelingLogic.getRequiredXp(equipped, tags) - toolXP; 46 | long requiredHeadXP = tags.hasKey("HeadEXP") && hLevel >= TConstructRegistry.getMaterial("Copper").harvestLevel() && hLevel < TConstructRegistry.getMaterial("Manyullyn").harvestLevel() ? LevelingLogic.getRequiredXp(equipped, tags) - headXP : -1; 47 | 48 | if (requiredHeadXP < requiredToolXP && requiredHeadXP > 0) 49 | LevelingLogic.updateXP(equipped, entityplayermp, toolXP + requiredHeadXP, headXP + requiredHeadXP); 50 | else 51 | LevelingLogic.updateXP(equipped, entityplayermp, toolXP + requiredToolXP, headXP + requiredToolXP); 52 | 53 | if (entityplayermp != icommandsender) 54 | { 55 | // TODO: Find replacement for notifyAdmins 56 | //notifyAdmins(icommandsender, 1, "Leveled up %s's tool", new Object[]{entityplayermp.getEntityName()}); 57 | } 58 | else 59 | { 60 | // TODO: Find replacement for notifyAdmins 61 | //notifyAdmins(icommandsender, 1, "Leveled up their own tool", new Object[]{}); 62 | } 63 | 64 | } else 65 | throw new WrongUsageException("Players tool is already max level", new Object[0]); 66 | } else 67 | throw new WrongUsageException("Player must have a levelable Tinker's Construct tool in hand", new Object[0]); 68 | } else 69 | throw new WrongUsageException("Player must have a Tinker's Construct tool in hand", new Object[0]); 70 | } 71 | 72 | 73 | /** 74 | * Parses an int from the given sring with a specified minimum. 75 | */ 76 | public static int parseIntWithMinMax(ICommandSender par0ICommandSender, String par1Str, int min, int max) 77 | { 78 | return parseIntBounded(par0ICommandSender, par1Str, min, max); 79 | } 80 | 81 | @Override 82 | public String getCommandUsage(ICommandSender icommandsender) { 83 | return null; 84 | } 85 | 86 | @Override 87 | public int compareTo (Object arg0) 88 | { 89 | return 0; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/util/HarvestLevels.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.util; 2 | 3 | import net.minecraft.util.EnumChatFormatting; 4 | import net.minecraft.util.StatCollector; 5 | import tconstruct.TConstruct; 6 | import tconstruct.library.tools.ToolMaterial; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import static net.minecraft.util.EnumChatFormatting.*; 12 | 13 | // strength of the tool-material. stone == strength of a stone pick etc. 14 | public final class HarvestLevels { 15 | private HarvestLevels() {} // non-instantiable 16 | 17 | public static int _0_stone = 0; 18 | public static int _1_flint = 1; 19 | public static int _2_copper = 2; 20 | public static int _3_iron = 3; 21 | public static int _4_bronze = 4; 22 | public static int _5_diamond = 5; 23 | public static int _6_obsidian = 6; 24 | public static int _7_ardite = 7; 25 | public static int _8_cobalt = 8; 26 | public static int _9_manyullym = 9; 27 | 28 | public static int max = 9; 29 | 30 | private static boolean vanilla = false; 31 | 32 | // needed if HarvestLevels module is deactivated to achieve vanilla mining levels 33 | public static void adjustToVanillaLevels() 34 | { 35 | _1_flint = 1; 36 | _2_copper = 1; 37 | _3_iron = 2; 38 | _4_bronze = 2; 39 | _5_diamond = 2; 40 | _6_obsidian = 3; 41 | _7_ardite = 4; 42 | _8_cobalt = 4; 43 | _9_manyullym = 5; 44 | 45 | max = 5; 46 | 47 | vanilla = true; 48 | } 49 | 50 | public static void updateHarvestLevelNames() 51 | { 52 | Map names = tconstruct.library.util.HarvestLevels.harvestLevelNames; 53 | 54 | if(vanilla) 55 | { 56 | names.put(0 , GRAY + StatCollector.translateToLocal("mininglevel.stone")); 57 | names.put(1 , DARK_RED + StatCollector.translateToLocal("mininglevel.iron")); 58 | names.put(2 , RED + StatCollector.translateToLocal("mininglevel.redstone")); 59 | names.put(3 , LIGHT_PURPLE + StatCollector.translateToLocal("mininglevel.obsidian")); 60 | names.put(4 , BLUE + StatCollector.translateToLocal("mininglevel.cobalt")); 61 | names.put(5 , DARK_PURPLE + StatCollector.translateToLocal("mininglevel.manyullyn")); 62 | names.put(6 , DARK_PURPLE + StatCollector.translateToLocal("mininglevel.manyullyn") + LIGHT_PURPLE + "+"); 63 | } 64 | else { 65 | names.put(0, GRAY + StatCollector.translateToLocal("mininglevel.stone")); 66 | names.put(1, GOLD + StatCollector.translateToLocal("mininglevel.copper")); 67 | names.put(2, DARK_GRAY + StatCollector.translateToLocal("mininglevel.iron")); 68 | names.put(3, WHITE + StatCollector.translateToLocal("mininglevel.tin")); 69 | names.put(4, RED + StatCollector.translateToLocal("mininglevel.redstone")); 70 | names.put(5, LIGHT_PURPLE + StatCollector.translateToLocal("mininglevel.obsidian")); 71 | names.put(6, DARK_RED + StatCollector.translateToLocal("mininglevel.ardite")); 72 | names.put(7, DARK_AQUA + StatCollector.translateToLocal("mininglevel.cobalt")); 73 | names.put(8, DARK_PURPLE + StatCollector.translateToLocal("mininglevel.manyullyn")); 74 | names.put(9, DARK_PURPLE + StatCollector.translateToLocal("mininglevel.manyullyn") + LIGHT_PURPLE + "+"); 75 | } 76 | } 77 | 78 | public static String getHarvestLevelName(int num) 79 | { 80 | return tconstruct.library.util.HarvestLevels.getHarvestLevelName(num); 81 | } 82 | 83 | public static void setCustomHarvestLevelNames(Map mats) 84 | { 85 | for(Map.Entry mat : mats.entrySet()) 86 | tconstruct.library.util.HarvestLevels.harvestLevelNames.put(mat.getKey(), mat.getValue().style() + mat.getValue().localizedName()); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/claybuckets/ClayBucketHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.claybuckets; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 5 | import net.minecraft.block.Block; 6 | import net.minecraft.block.material.Material; 7 | import net.minecraft.entity.passive.EntityCow; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.init.Blocks; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.util.MovingObjectPosition; 12 | import net.minecraftforge.event.entity.player.EntityInteractEvent; 13 | import net.minecraftforge.event.entity.player.FillBucketEvent; 14 | import tconstruct.smeltery.TinkerSmeltery; 15 | 16 | public class ClayBucketHandler { 17 | // milking cows 18 | @SubscribeEvent 19 | public void EntityInteract(EntityInteractEvent event) 20 | { 21 | if(event.target == null || !(event.target instanceof EntityCow)) 22 | return; 23 | if(event.entityPlayer == null) 24 | return; 25 | 26 | ItemStack equipped = event.entityPlayer.getCurrentEquippedItem(); 27 | // bucket present? 28 | if(equipped == null || equipped.getItem() != IguanaItems.clayBucketFired) 29 | return; 30 | 31 | EntityPlayer player = event.entityPlayer; 32 | 33 | if (equipped.stackSize-- == 1) 34 | { 35 | player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(IguanaItems.clayBucketMilk)); 36 | } 37 | else if (!player.inventory.addItemStackToInventory(new ItemStack(IguanaItems.clayBucketMilk))) 38 | { 39 | player.dropPlayerItemWithRandomChoice(new ItemStack(IguanaItems.clayBucketMilk, 1, 0), false); 40 | } 41 | } 42 | 43 | // filling buckets with molten metal, same behaviour as regular buckets from TConstruct, but with clay buckets 44 | @SubscribeEvent 45 | public void bucketFill (FillBucketEvent event) 46 | { 47 | if (event.current.getItem() == IguanaItems.clayBucketFired && event.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) 48 | { 49 | if(event.getResult() != Event.Result.DEFAULT) 50 | return; 51 | 52 | int hitX = event.target.blockX; 53 | int hitY = event.target.blockY; 54 | int hitZ = event.target.blockZ; 55 | 56 | if (event.entityPlayer != null && !event.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, event.target.sideHit, event.current)) 57 | { 58 | return; 59 | } 60 | 61 | Block bID = event.world.getBlock(hitX, hitY, hitZ); 62 | 63 | // tinkers fluids 64 | for (int id = 0; id < TinkerSmeltery.fluidBlocks.length; id++) 65 | { 66 | if (bID == TinkerSmeltery.fluidBlocks[id]) 67 | { 68 | event.world.setBlockToAir(hitX, hitY, hitZ); 69 | if (!event.entityPlayer.capabilities.isCreativeMode) 70 | { 71 | event.world.setBlockToAir(hitX, hitY, hitZ); 72 | 73 | event.setResult(Event.Result.ALLOW); 74 | event.result = new ItemStack(IguanaItems.clayBucketsTinkers, 1, id); 75 | return; 76 | } 77 | } 78 | } 79 | 80 | // water and lava 81 | if(bID == Blocks.water || bID == Blocks.flowing_water) 82 | { 83 | event.setResult(Event.Result.ALLOW); 84 | event.result = new ItemStack(IguanaItems.clayBucketWater); 85 | event.world.setBlockToAir(hitX, hitY, hitZ); 86 | 87 | return; 88 | } 89 | if(bID == Blocks.lava || bID == Blocks.flowing_lava) 90 | { 91 | event.setResult(Event.Result.ALLOW); 92 | event.result = new ItemStack(IguanaItems.clayBucketLava); 93 | event.world.setBlockToAir(hitX, hitY, hitZ); 94 | 95 | return; 96 | } 97 | 98 | event.setCanceled(true); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/harvestlevels/IguanaHarvestLevelTweaks.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.harvestlevels; 2 | 3 | import cpw.mods.fml.common.SidedProxy; 4 | import cpw.mods.fml.common.event.FMLInitializationEvent; 5 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 6 | import iguanaman.iguanatweakstconstruct.harvestlevels.modifiers.ModBonusMiningLevel; 7 | import iguanaman.iguanatweakstconstruct.reference.Config; 8 | import iguanaman.iguanatweakstconstruct.reference.Reference; 9 | import iguanaman.iguanatweakstconstruct.restriction.RestrictionHelper; 10 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 11 | import iguanaman.iguanatweakstconstruct.util.Log; 12 | import mantle.pulsar.pulse.Handler; 13 | import mantle.pulsar.pulse.Pulse; 14 | import net.minecraft.init.Items; 15 | import net.minecraft.item.Item; 16 | import net.minecraft.item.ItemStack; 17 | import net.minecraftforge.common.MinecraftForge; 18 | import tconstruct.TConstruct; 19 | import tconstruct.library.TConstructRegistry; 20 | import tconstruct.library.crafting.ModifyBuilder; 21 | import tconstruct.library.modifier.ItemModifier; 22 | import tconstruct.library.tools.ToolMaterial; 23 | import tconstruct.modifiers.tools.ModDurability; 24 | import tconstruct.tools.TinkerTools; 25 | import tconstruct.util.config.PHConstruct; 26 | import tconstruct.world.TinkerWorld; 27 | 28 | import java.lang.reflect.Field; 29 | import java.util.List; 30 | import java.util.Map; 31 | 32 | /** 33 | * The Harvest-Tweaks Pulse. If this were a separate mod instead of pulse-module, it'd be a @Mod 34 | * This pulse modifies the harvest level of all tools and blocks. 35 | * Check util.HarvestLevels for more info. 36 | * 37 | * Check the oreDictlevels to get an idea of what can be harvested with each tier. 38 | */ 39 | 40 | @Pulse(id = Reference.PULSE_HARVESTTWEAKS, description = "Modify tool and item mining levels to create a tiered-ish progression") 41 | public class IguanaHarvestLevelTweaks { 42 | 43 | @Handler 44 | public void postInit(FMLPostInitializationEvent event) 45 | { 46 | TinkerMaterialTweaks.modifyToolMaterials(); 47 | HarvestLevelTweaks.modifyHarvestLevels(); 48 | MinecraftForge.EVENT_BUS.register(new VanillaToolTipHandler()); 49 | 50 | if(Config.changeDiamondModifier) 51 | changeDurabilityModifiers(); 52 | 53 | if(TConstruct.pulsar.isPulseLoaded("Tinkers' World")) 54 | adaptChestLoot(); 55 | } 56 | 57 | // removes all pickaxe and hammer heads that have a higher harvestlevel than flint 58 | private void adaptChestLoot() 59 | { 60 | for(Map.Entry mat : TConstructRegistry.toolMaterials.entrySet()) 61 | { 62 | // we allow flint and lower 63 | if(mat.getValue().harvestLevel() <= HarvestLevels._1_flint) 64 | continue; 65 | 66 | // remove pickaxe head 67 | TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(TinkerTools.pickaxeHead, 1, mat.getKey())); 68 | // remove hammer head 69 | TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(TinkerTools.hammerHead, 1, mat.getKey())); 70 | // shovel 71 | TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(TinkerTools.shovelHead, 1, mat.getKey())); 72 | // excavator 73 | TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(TinkerTools.excavatorHead, 1, mat.getKey())); 74 | // hatchet 75 | TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(TinkerTools.hatchetHead, 1, mat.getKey())); 76 | // lumberaxe 77 | TinkerWorld.tinkerHouseChest.removeItem(new ItemStack(TinkerTools.broadAxeHead, 1, mat.getKey())); 78 | // other stuff should be fine 79 | } 80 | } 81 | 82 | private void changeDurabilityModifiers() 83 | { 84 | // deactivate mininglevel increase by tcon 85 | PHConstruct.miningLevelIncrease = false; 86 | 87 | Log.debug("Adding Diamond/Emerald Modifiers for Mining Levels"); 88 | ModifyBuilder.registerModifier(new ModBonusMiningLevel(new ItemStack[] {new ItemStack(Items.diamond) }, "Diamond")); 89 | ModifyBuilder.registerModifier(new ModBonusMiningLevel(new ItemStack[] {new ItemStack(Items.emerald) }, "Emerald")); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/debug/DebugCommand.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.debug; 2 | 3 | import iguanaman.iguanatweakstconstruct.leveling.RandomBonuses; 4 | import net.minecraft.command.CommandBase; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.entity.player.EntityPlayerMP; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.ChatComponentText; 9 | import tconstruct.library.crafting.ToolBuilder; 10 | import tconstruct.library.tools.ToolCore; 11 | import tconstruct.tools.TinkerTools; 12 | 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | public class DebugCommand extends CommandBase { 17 | 18 | @Override 19 | public String getCommandName() { 20 | return "igdebug"; 21 | } 22 | 23 | /** 24 | * Return the required permission level for this command. 25 | */ 26 | @Override 27 | public int getRequiredPermissionLevel() 28 | { 29 | return 2; 30 | } 31 | 32 | 33 | @Override 34 | public void processCommand(ICommandSender icommandsender, String[] astring) { 35 | EntityPlayerMP entityplayermp = astring.length >= 1 ? getPlayer(icommandsender, astring[0]) : getCommandSenderAsPlayer(icommandsender); 36 | ItemStack equipped = entityplayermp.getCurrentEquippedItem(); 37 | if (equipped != null && equipped.getItem() instanceof ToolCore) { 38 | //Config.randomBonusesAreUseful = true; 39 | //Config.randomBonusesAreRandom = false; 40 | HashMap foo = new HashMap(); 41 | for(int i = 0; i < 1000; i++) { 42 | { 43 | // pick 44 | //ItemStack head = new ItemStack(TinkerTools.pickaxeHead, 0, 2); 45 | //ItemStack handle = new ItemStack(TinkerTools.toolRod, 0, 3); 46 | //ItemStack accessory = new ItemStack(TinkerTools.binding, 0, 4); 47 | // sword 48 | //ItemStack head = new ItemStack(TinkerTools.swordBlade, 0, 2); 49 | //ItemStack handle = new ItemStack(TinkerTools.toolRod, 0, 3); 50 | //ItemStack accessory = new ItemStack(TinkerTools.wideGuard, 0, 4); 51 | // bow 52 | ItemStack head = new ItemStack(TinkerTools.toolRod, 0, 2); 53 | ItemStack handle = new ItemStack(TinkerTools.bowstring, 0, 0); 54 | ItemStack accessory = new ItemStack(TinkerTools.toolRod, 0, 4); 55 | ItemStack tool = ToolBuilder.instance.buildTool(head, handle, accessory, "testtool"); 56 | for(int j = 0; j < 5; j++) { 57 | RandomBonuses.Modifier mod = RandomBonuses.tryModifying(entityplayermp, tool); 58 | if (!foo.containsKey(mod)) 59 | foo.put(mod, 1); 60 | else 61 | foo.put(mod, foo.get(mod) + 1); 62 | } 63 | } 64 | } 65 | 66 | for(Map.Entry bar : foo.entrySet()) 67 | icommandsender.addChatMessage(new ChatComponentText(bar.getKey().toString() + ": " + bar.getValue())); 68 | /* 69 | NBTTagCompound tags = equipped.getTagCompound().getCompoundTag("InfiTool"); 70 | int tipNum = 0; 71 | while (true) { 72 | tipNum++; 73 | String tip = "Tooltip" + tipNum; 74 | String modTip = "ModifierTip" + tipNum; 75 | 76 | boolean found = false; 77 | if (tags.hasKey(tip)) { 78 | Log.info(tip + ": " + tags.getString(tip)); 79 | found = true; 80 | } 81 | if (tags.hasKey(modTip)) { 82 | Log.info(modTip + ": " + tags.getString(tip)); 83 | found = true; 84 | } 85 | 86 | if (!found) 87 | break; 88 | } 89 | */ 90 | } 91 | } 92 | 93 | 94 | @Override 95 | public String getCommandUsage(ICommandSender icommandsender) { 96 | return null; 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/override/HarvestLevelNameOverride.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.override; 2 | 3 | import cpw.mods.fml.common.registry.GameRegistry; 4 | import iguanaman.iguanatweakstconstruct.reference.Config; 5 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 6 | import iguanaman.iguanatweakstconstruct.util.Log; 7 | import net.minecraft.item.Item; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraftforge.common.config.ConfigCategory; 10 | import net.minecraftforge.common.config.Configuration; 11 | import net.minecraftforge.common.config.Property; 12 | import tconstruct.library.TConstructRegistry; 13 | import tconstruct.library.tools.ToolMaterial; 14 | 15 | import java.util.HashMap; 16 | import java.util.Map; 17 | 18 | public class HarvestLevelNameOverride implements IOverride { 19 | @Override 20 | public void createDefault(Configuration config) { 21 | Log.debug("Creating Harvest Level Name Default File"); 22 | 23 | config.get("HarvestLevelNames", "Level0", "Stone"); 24 | config.get("HarvestLevelNames", "Level1", "Copper"); 25 | config.get("HarvestLevelNames", "Level2", "Iron"); 26 | config.get("HarvestLevelNames", "Level3", "Bronze"); 27 | config.get("HarvestLevelNames", "Level4", "Steel"); 28 | config.get("HarvestLevelNames", "Level5", "Obsidian"); 29 | config.get("HarvestLevelNames", "Level6", "Ardite"); 30 | config.get("HarvestLevelNames", "Level7", "Cobalt"); 31 | config.get("HarvestLevelNames", "Level8", "Manyullyn"); 32 | } 33 | 34 | @Override 35 | public void processConfig(Configuration config) { 36 | Log.debug("Loading Harvest Level Name Overrides"); 37 | 38 | ConfigCategory cat = config.getCategory("HarvestLevelNames"); 39 | cat.setComment("Use materialnames to set the name of a harvest level. The entrties have to either be identifiers for Tinker-Materials OR the registered names of items.\nFor Example: 'Level0=wood' would change the first harvest level to wood from stone. Likewise 'Level5=minecraft:emerald' would change that level to Emerald."); 40 | 41 | Map mats = new HashMap(); 42 | 43 | for(Property prop : cat.values()) 44 | { 45 | if(!prop.getName().startsWith("Level")) 46 | { 47 | Log.error("Invalid entry: " + prop.getName()); 48 | continue; 49 | } 50 | Integer lvl; 51 | try { 52 | lvl = Integer.valueOf(prop.getName().substring(5)); 53 | } 54 | catch(NumberFormatException e) 55 | { 56 | Log.error("Invalid entry: " + prop.getName()); 57 | continue; 58 | } 59 | 60 | // find material. we have to loop through all materials, because configs don't like case sensitivity. 61 | String matName = prop.getString().toLowerCase(); 62 | boolean found = false; 63 | for(ToolMaterial mat : TConstructRegistry.toolMaterials.values()) 64 | if(matName.equals(mat.name().toLowerCase())) 65 | { 66 | mats.put(lvl, mat); 67 | if(Config.logOverrideChanges) 68 | Log.info(String.format("Harvest Level Name Override: Changed Level %s to %s", lvl, mat.materialName)); 69 | found = true; 70 | break; 71 | } 72 | 73 | // if it's not a material, we try items 74 | if(!found) { 75 | matName = prop.getString(); 76 | Item item = (Item)Item.itemRegistry.getObject(matName); 77 | if(item != null) { 78 | String name = (new ItemStack(item)).getDisplayName(); 79 | tconstruct.library.util.HarvestLevels.harvestLevelNames.put(lvl, name); 80 | 81 | if(Config.logOverrideChanges) 82 | Log.info(String.format("Harvest Level Name Override: Changed Level %s to %s", lvl, name)); 83 | found = true; 84 | } 85 | } 86 | 87 | if(!found) { 88 | Log.error("No Tinkers Construct material found: " + prop.getString()); 89 | Log.error("Entries have to be a registered material for Tinker Tools!"); 90 | } 91 | } 92 | 93 | HarvestLevels.setCustomHarvestLevelNames(mats); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/tweaks/ToolCraftingRecipe.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.tweaks; 2 | 3 | import com.google.common.collect.Sets; 4 | import iguanaman.iguanatweakstconstruct.reference.Config; 5 | import iguanaman.iguanatweakstconstruct.reference.Reference; 6 | import net.minecraft.inventory.InventoryCrafting; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.item.crafting.IRecipe; 9 | import net.minecraft.world.World; 10 | import net.minecraftforge.oredict.RecipeSorter; 11 | import tconstruct.library.crafting.ToolBuilder; 12 | import tconstruct.library.tools.ToolCore; 13 | import tconstruct.library.util.IToolPart; 14 | 15 | import java.util.HashSet; 16 | import java.util.LinkedList; 17 | import java.util.List; 18 | import java.util.Set; 19 | 20 | public class ToolCraftingRecipe implements IRecipe { 21 | static { 22 | // register the recipe with the recipesorter 23 | RecipeSorter.register(Reference.MOD_ID + ":tool", RepairCraftingRecipe.class, RecipeSorter.Category.SHAPELESS, ""); 24 | } 25 | 26 | private ItemStack outputTool; 27 | 28 | @Override 29 | public boolean matches(InventoryCrafting inventoryCrafting, World world) { 30 | outputTool = null; 31 | 32 | List input = new LinkedList(); 33 | 34 | boolean hasToolPart = false; 35 | 36 | for(int i = 0; i < inventoryCrafting.getSizeInventory(); i++) 37 | { 38 | ItemStack slot = inventoryCrafting.getStackInSlot(i); 39 | // empty slot 40 | if(slot == null) 41 | continue; 42 | 43 | // is it a toolpart? 44 | if(slot.getItem() instanceof IToolPart) 45 | hasToolPart = true; 46 | 47 | // save it 48 | input.add(slot); 49 | } 50 | 51 | // at least 1 of the used parts has to be a toolpart 52 | // this is only a performance optimization. It allows to use sticks as handles while 53 | // not checking all possible permutations for recipes that don't even contain toolparts 54 | if(!hasToolPart) 55 | return false; 56 | 57 | // check correct size 58 | if(input.size() < 2 || (input.size() > 3 && !Config.easyAdvancedToolBuilding)) 59 | return false; 60 | 61 | // ok. we have to cycle through all permutations. urgh. 62 | Set> permutations = new HashSet>(); 63 | permutate(new LinkedList(), input, permutations); 64 | 65 | for(List comb : permutations) 66 | { 67 | ItemStack tool = null; 68 | ItemStack accessory = null, extra = null; 69 | if(comb.size() > 2) 70 | accessory = comb.get(2); 71 | if(comb.size() > 3) 72 | extra = comb.get(3); 73 | 74 | // try this combination xX 75 | tool = ToolBuilder.instance.buildTool(comb.get(0), comb.get(1), accessory, extra, ""); 76 | 77 | if(tool != null) 78 | { 79 | outputTool = tool; 80 | return true; 81 | } 82 | } 83 | 84 | return false; 85 | } 86 | 87 | private void permutate(List cur, List rest, Set> output) 88 | { 89 | // if we reached the last element, add the combination to the output 90 | if(rest.size() == 1) { 91 | List out = new LinkedList(cur); 92 | out.add(rest.get(0)); 93 | output.add(out); 94 | } 95 | // otherwise recursively cycle through all other variations 96 | else { 97 | for(ItemStack foo : rest) 98 | { 99 | List newCur = new LinkedList(cur); 100 | List newRest = new LinkedList(rest); 101 | newCur.add(foo); 102 | newRest.remove(foo); 103 | permutate(newCur, newRest, output); 104 | } 105 | } 106 | } 107 | 108 | @Override 109 | public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { 110 | return outputTool; 111 | } 112 | 113 | @Override 114 | public int getRecipeSize() { 115 | return 2; 116 | } 117 | 118 | @Override 119 | public ItemStack getRecipeOutput() { 120 | return outputTool; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/override/ToolOverride.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.override; 2 | 3 | import iguanaman.iguanatweakstconstruct.harvestlevels.HarvestLevelTweaks; 4 | import iguanaman.iguanatweakstconstruct.reference.Config; 5 | import iguanaman.iguanatweakstconstruct.reference.Reference; 6 | import iguanaman.iguanatweakstconstruct.util.HarvestLevels; 7 | import iguanaman.iguanatweakstconstruct.util.Log; 8 | import net.minecraft.item.Item; 9 | import net.minecraft.item.ItemBlock; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraftforge.common.config.ConfigCategory; 12 | import net.minecraftforge.common.config.Configuration; 13 | import net.minecraftforge.common.config.Property; 14 | 15 | import java.io.File; 16 | 17 | public class ToolOverride implements IOverride { 18 | @Override 19 | public void createDefault(Configuration config) { 20 | Log.debug("Creating Tool Default File"); 21 | 22 | for(Object identifier : Item.itemRegistry.getKeys()) 23 | { 24 | Object o = Item.itemRegistry.getObject(identifier); 25 | if(!(o instanceof Item) || o instanceof ItemBlock) 26 | continue; 27 | 28 | Item item = (Item)o; 29 | ItemStack stack = new ItemStack(item); // let's assume there are no sick bastards who use metadata to group tools into a singular id ._. 30 | 31 | String saneCategory = buildCategory(identifier.toString()); 32 | 33 | for(String tool : item.getToolClasses(stack)) 34 | { 35 | int level = item.getHarvestLevel(stack, tool); 36 | config.get(saneCategory, tool, level).getInt(); 37 | } 38 | } 39 | } 40 | 41 | @Override 42 | public void processConfig(Configuration config) { 43 | Log.debug("Loading Tool Overrides"); 44 | 45 | StringBuilder comment = new StringBuilder(); 46 | comment.append("Copy the desired tools you want to change from the defaults file into this file and adapt the stats.\n\n"); 47 | 48 | comment.append("Mining Levels:\n"); 49 | for(int i = 0; i <= HarvestLevels.max; i++) 50 | comment.append(String.format("\t%d - %s\n", i, HarvestLevels.getHarvestLevelName(i))); 51 | 52 | config.setCategoryComment(" Info", comment.toString()); 53 | Property prop = config.get(" Info", "fillWithDefault", false, "Fills this file with the default values, not altering changed values."); 54 | boolean fillWithDefault = prop.getBoolean(); 55 | prop.set(false); 56 | prop = config.get(" Info", "removeDefaultValues", false, "Removes all entries that correspond to the default values."); 57 | boolean cleanup = prop.getBoolean(); 58 | prop.set(false); 59 | 60 | for(Object identifier : Item.itemRegistry.getKeys()) 61 | { 62 | Object o = Item.itemRegistry.getObject(identifier); 63 | if(!(o instanceof Item) || o instanceof ItemBlock) 64 | continue; 65 | // only load if it has a value 66 | String saneCategory = buildCategory(identifier.toString()); 67 | 68 | if(!config.hasCategory(saneCategory) && !fillWithDefault) 69 | continue; 70 | 71 | Item item = (Item)o; 72 | ItemStack stack = new ItemStack(item); // let's assume there are no sick bastards who use metadata to group tools into a singular id ._. 73 | 74 | boolean changed = false; 75 | for(String tool : item.getToolClasses(stack)) 76 | { 77 | int level = item.getHarvestLevel(stack, tool); 78 | prop = config.get(saneCategory, tool, level); 79 | int newLevel = prop.getInt(); 80 | 81 | // update tool 82 | if(level != newLevel) { 83 | HarvestLevelTweaks.updateToolHarvestLevel(item, tool, newLevel); 84 | if(Config.logOverrideChanges) 85 | Log.info(String.format("Tool Override: Changed harvest level of %s to %d", item.getUnlocalizedName(), newLevel)); 86 | changed = true; 87 | } 88 | } 89 | if(!changed && cleanup) 90 | config.removeCategory(config.getCategory(saneCategory)); 91 | } 92 | } 93 | 94 | private String buildCategory(String identifier) 95 | { 96 | // make it sane 97 | String cat = identifier.replace(Configuration.CATEGORY_SPLITTER, "_"); // replace '.' in string.. blah. this sucks 98 | // then split it into subcategory of mod-id 99 | return cat.replaceFirst(":", Configuration.CATEGORY_SPLITTER).toLowerCase(); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/restriction/PartRestrictionHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.restriction; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 5 | import iguanaman.iguanatweakstconstruct.util.TooltipHelper; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.EnumChatFormatting; 9 | import net.minecraft.util.StatCollector; 10 | import net.minecraftforge.event.entity.player.ItemTooltipEvent; 11 | import net.minecraftforge.oredict.OreDictionary; 12 | import tconstruct.library.TConstructRegistry; 13 | import tconstruct.library.crafting.CastingRecipe; 14 | import tconstruct.library.crafting.PatternBuilder; 15 | import tconstruct.library.event.PartBuilderEvent; 16 | import tconstruct.library.event.SmelteryCastEvent; 17 | import tconstruct.library.tools.CustomMaterial; 18 | import tconstruct.library.tools.ToolMaterial; 19 | import tconstruct.library.util.IPattern; 20 | import tconstruct.library.util.IToolPart; 21 | import tconstruct.weaponry.TinkerWeaponry; 22 | 23 | import java.util.List; 24 | 25 | public class PartRestrictionHandler { 26 | @SubscribeEvent 27 | public void onPartBuilding(PartBuilderEvent.NormalPart event) 28 | { 29 | PatternBuilder.ItemKey key = PatternBuilder.instance.getItemKey(event.material); 30 | if(key == null) 31 | return; 32 | 33 | // bowstring and fletching 34 | if(event.pattern.getItemDamage() == 23 || event.pattern.getItemDamage() == 24) 35 | return; 36 | 37 | PatternBuilder.MaterialSet set = ((PatternBuilder.MaterialSet)PatternBuilder.instance.materialSets.get(key.key)); 38 | if(set == null) 39 | return; 40 | 41 | ToolMaterial mat = TConstructRegistry.getMaterial(set.materialID); 42 | 43 | if(RestrictionHelper.isRestricted(event.pattern, mat)) 44 | event.setResult(Event.Result.DENY); 45 | } 46 | 47 | @SubscribeEvent 48 | public void onPartCasting(SmelteryCastEvent.CastingTable event) 49 | { 50 | // null checks 51 | if(event.recipe == null || event.recipe.output == null) 52 | return; 53 | // we allow all bolts 54 | if(event.recipe.output.getItem() == TinkerWeaponry.partBolt) 55 | return; 56 | 57 | CastingRecipe recipe = event.recipe; 58 | ItemStack output = recipe.output; 59 | 60 | if(output.getItem() == null || !(output.getItem() instanceof IToolPart)) 61 | return; 62 | 63 | IToolPart part = (IToolPart)output.getItem(); 64 | ToolMaterial mat = TConstructRegistry.getMaterial(part.getMaterialID(output)); 65 | if(RestrictionHelper.isRestricted(event.recipe.cast, mat)) 66 | event.setResult(Event.Result.DENY); 67 | } 68 | 69 | @SubscribeEvent 70 | public void onItemToolTip(ItemTooltipEvent event) { 71 | if (event.entityPlayer == null) 72 | return; 73 | 74 | // we're only interested if it's a tool part 75 | if (!(event.itemStack.getItem() instanceof IPattern)) 76 | return; 77 | 78 | // only display on shift 79 | if(!TooltipHelper.shiftHeld()) 80 | { 81 | event.toolTip.add(StatCollector.translateToLocalFormatted("tooltip.pattern.advanced", EnumChatFormatting.YELLOW.toString() + EnumChatFormatting.ITALIC + "Shift" + EnumChatFormatting.RESET + EnumChatFormatting.GRAY)); 82 | return; 83 | } 84 | 85 | boolean foundMat = false; 86 | // regular materials 87 | List materials = RestrictionHelper.getPatternMaterials(event.itemStack); 88 | if(materials != null) { 89 | for (ToolMaterial mat : materials) { 90 | event.toolTip.add(mat.style() + mat.localizedName()); 91 | } 92 | foundMat = true; 93 | } 94 | 95 | // custom materials 96 | List customMaterials = RestrictionHelper.getPatternCustomMaterials(event.itemStack); 97 | if(customMaterials != null) { 98 | for (CustomMaterial mat : customMaterials) { 99 | if(mat.input != null) 100 | event.toolTip.add(mat.input.getDisplayName()); 101 | else if(mat.oredict != null) 102 | { 103 | List ores = OreDictionary.getOres(mat.oredict); 104 | if(ores != null && !ores.isEmpty()) 105 | event.toolTip.add(String.format("%s (%s)", ores.get(0).getDisplayName(), mat.oredict)); 106 | } 107 | } 108 | foundMat = true; 109 | } 110 | 111 | if(!foundMat) 112 | event.toolTip.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("tooltip.pattern.noMaterials")); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/main/java/iguanaman/iguanatweakstconstruct/mobheads/handlers/MobHeadHandler.java: -------------------------------------------------------------------------------- 1 | package iguanaman.iguanatweakstconstruct.mobheads.handlers; 2 | 3 | import cpw.mods.fml.common.eventhandler.EventPriority; 4 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 5 | import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; 6 | import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads; 7 | import iguanaman.iguanatweakstconstruct.mobheads.items.IguanaSkull; 8 | import iguanaman.iguanatweakstconstruct.reference.Config; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.EntityList; 11 | import net.minecraft.entity.item.EntityItem; 12 | import net.minecraft.entity.monster.*; 13 | import net.minecraft.entity.player.EntityPlayer; 14 | import net.minecraft.init.Items; 15 | import net.minecraft.item.Item; 16 | import net.minecraft.item.ItemStack; 17 | import net.minecraftforge.common.util.FakePlayer; 18 | import net.minecraftforge.event.entity.living.LivingDropsEvent; 19 | import tconstruct.library.tools.ToolCore; 20 | import tconstruct.tools.TinkerTools; 21 | 22 | import java.util.Iterator; 23 | 24 | public class MobHeadHandler { 25 | @SubscribeEvent(priority = EventPriority.LOWEST) 26 | public void LivingDrops(LivingDropsEvent event) 27 | { 28 | // remove regular skull drops (because we modify its drop chance) 29 | Iterator i = event.drops.iterator(); 30 | while (i.hasNext()) { 31 | EntityItem eitem = i.next(); 32 | 33 | if (eitem != null) 34 | if (eitem.getEntityItem() != null) 35 | { 36 | ItemStack item = eitem.getEntityItem(); 37 | if (item.getItem() == Items.skull && item.getItemDamage() != 3) 38 | i.remove(); 39 | } 40 | } 41 | 42 | // add our own drops if the damage source was a player (and no fake player) 43 | Entity entity = event.source.getEntity(); 44 | if(entity == null) 45 | return; 46 | if(!(entity instanceof EntityPlayer) || entity instanceof FakePlayer) 47 | return; 48 | 49 | // how much beheading chance do we have? 50 | EntityPlayer player = (EntityPlayer) event.source.getEntity(); 51 | ItemStack stack = player.getCurrentEquippedItem(); 52 | int beheading = 0; 53 | if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore) 54 | { 55 | beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading"); 56 | if (stack.getItem() == TinkerTools.cleaver) 57 | beheading += 2; 58 | } 59 | // roll the dice 60 | if(IguanaTweaksTConstruct.random.nextInt(100) > beheading * Config.beheadingHeadDropChance + Config.baseHeadDropChance) 61 | return; 62 | 63 | Item skullItem = null; 64 | int skullId = -1; 65 | 66 | Entity mob = event.entityLiving; 67 | // skelly/witherskelly 68 | if (mob instanceof EntitySkeleton) { 69 | skullItem = Items.skull; 70 | skullId = ((EntitySkeleton) event.entityLiving).getSkeletonType(); 71 | } 72 | else if (mob instanceof EntityPigZombie) { 73 | skullItem = IguanaMobHeads.skullItem; 74 | skullId = IguanaSkull.META_PIGZOMBIE; 75 | } 76 | else if (mob instanceof EntityZombie) { 77 | skullItem = Items.skull; 78 | skullId = 2; 79 | } 80 | else if (mob instanceof EntityCreeper) { 81 | skullItem = Items.skull; 82 | skullId = 4; 83 | } 84 | else if (mob instanceof EntityEnderman) { 85 | skullItem = IguanaMobHeads.skullItem; 86 | skullId = IguanaSkull.META_ENDERMAN; 87 | 88 | // sometimes, very very rarely, you'll only get the jaw :D 89 | if(IguanaTweaksTConstruct.random.nextInt(1000) == 0) 90 | { 91 | skullItem = IguanaMobHeads.wearables; 92 | skullId = 2; 93 | } 94 | } 95 | else if (mob instanceof EntityBlaze) { 96 | skullItem = IguanaMobHeads.skullItem; 97 | skullId = IguanaSkull.META_BLAZE; 98 | } 99 | // mod support 100 | else { 101 | String mobName = EntityList.getEntityString(mob); 102 | // thermal expansion 103 | if("Blizz".equals(mobName)) 104 | { 105 | skullItem = IguanaMobHeads.skullItem; 106 | skullId = IguanaSkull.META_BLIZZ; 107 | } 108 | } 109 | 110 | // no skull found? 111 | if(skullItem == null) 112 | return; 113 | 114 | // drop it like it's hot 115 | EntityItem entityitem = new EntityItem(mob.worldObj, mob.posX, mob.posY, mob.posZ, new ItemStack(skullItem, 1, skullId)); 116 | entityitem.delayBeforeCanPickup =10; 117 | event.drops.add(entityitem); 118 | } 119 | } 120 | --------------------------------------------------------------------------------