1.9 update is done!

This commit is contained in:
oitsjustjose 2016-05-29 11:12:51 -05:00
commit 7e8a65a994
5 changed files with 36 additions and 30 deletions

View file

@ -1,5 +1,3 @@
// For those who want the bleeding edge
buildscript { buildscript {
repositories { repositories {
jcenter() jcenter()
@ -22,12 +20,13 @@ repositories {
version = "1.0" version = "1.0"
group= "com.oitsjustjose.tinkers_addons" group= "com.oitsjustjose.tinkers_addons"
archivesBaseName = "Tinkers' Addons-1.8.9" archivesBaseName = "Tinkers' Addons-1.9"
minecraft { minecraft {
version = "1.8.9-11.15.1.1902-1.8.9" version = "1.9-12.16.1.1923"
if (file('../../run').exists()){
runDir = "../../run" if (file('../run').exists()){
runDir = "../run"
} else { } else {
runDir = "run" runDir = "run"
} }
@ -35,13 +34,13 @@ minecraft {
replaceIn "lib/Lib.java" replaceIn "lib/Lib.java"
replace "@VERSION@", project.version replace "@VERSION@", project.version
mappings = "stable_20" mappings = "snapshot_20160312"
} }
dependencies { dependencies {
deobfCompile "mezz.jei:jei_1.8.9:2.28.9.176" deobfCompile "mezz.jei:jei_1.9:3.3.3.200"
deobfCompile "slimeknights.mantle:Mantle:1.8.9-0.9.2.jenkins102" deobfCompile "slimeknights.mantle:Mantle:1.9-0.10.1.jenkins140"
deobfCompile "slimeknights:TConstruct:1.8.9-2.2.1.jenkins1005" deobfCompile "slimeknights:TConstruct:1.9-2.3.1.jenkins226"
} }
task deobfJar(type: Jar) { task deobfJar(type: Jar) {
@ -53,10 +52,13 @@ artifacts{
archives deobfJar archives deobfJar
} }
processResources{ processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info' include 'mcmod.info'
expand 'version':project.version, 'mcversion':project.minecraft.version expand 'version':project.version, 'mcversion':project.minecraft.version

View file

@ -17,7 +17,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = Lib.MODID, name = Lib.NAME, version = Lib.VERSION, guiFactory = Lib.GUI_FACTORY, acceptedMinecraftVersions = "1.8.9", dependencies = "required-after:tconstruct@[1.8.9-2.2.1,);" + "required-after:mantle@[1.8.9-0.9.0,)") @Mod(modid = Lib.MODID, name = Lib.NAME, version = Lib.VERSION, guiFactory = Lib.GUI_FACTORY, acceptedMinecraftVersions = "1.9", dependencies = "required-after:tconstruct@[1.9-2.3.1,);" + "required-after:mantle@[1.9-0.10.1,)")
public class TinkersAddons public class TinkersAddons
{ {
@Instance(Lib.MODID) @Instance(Lib.MODID)

View file

@ -26,20 +26,20 @@ public class Config
{ {
Property property; Property property;
property = config.get(config.CATEGORY_GENERAL, "Enable Auto-Repair", true).setRequiresMcRestart(true); property = config.get(Configuration.CATEGORY_GENERAL, "Enable Auto-Repair", true).setRequiresMcRestart(true);
property.comment = "Allows you to enable or disable the auto-repair trait"; property.setComment("Allows you to enable or disable the auto-repair trait");
enableAutoRepair = property.getBoolean(); enableAutoRepair = property.getBoolean();
property = config.get(config.CATEGORY_GENERAL, "Enable 1st bonus modifier mod for tools", true).setRequiresMcRestart(true); property = config.get(Configuration.CATEGORY_GENERAL, "Enable 1st bonus modifier mod for tools", true).setRequiresMcRestart(true);
property.comment = "Re-adds the diamond + gold block recipe to increase modifiers on a tool if enabled"; property.setComment("Re-adds the diamond + gold block recipe to increase modifiers on a tool if enabled");
enableExtraModifierLvl1 = property.getBoolean(); enableExtraModifierLvl1 = property.getBoolean();
property = config.get(config.CATEGORY_GENERAL, "Enable 2nd bonus modifier mod for tools", true).setRequiresMcRestart(true); property = config.get(Configuration.CATEGORY_GENERAL, "Enable 2nd bonus modifier mod for tools", true).setRequiresMcRestart(true);
property.comment = "Re-adds the diamond block + gold apple recipe to increase modifiers on a tool if enabled"; property.setComment("Re-adds the diamond block + gold apple recipe to increase modifiers on a tool if enabled");
enableExtraModifierLvl2 = property.getBoolean(); enableExtraModifierLvl2 = property.getBoolean();
property = config.get(config.CATEGORY_GENERAL, "Enable 3rd bonus modifier mod for tools", true).setRequiresMcRestart(true); property = config.get(Configuration.CATEGORY_GENERAL, "Enable 3rd bonus modifier mod for tools", true).setRequiresMcRestart(true);
property.comment = "Re-adds the nether star recipe to increase modifiers on a tool if enabled"; property.setComment("Re-adds the nether star recipe to increase modifiers on a tool if enabled");
enableExtraModifierLvl3 = property.getBoolean(); enableExtraModifierLvl3 = property.getBoolean();
if (config.hasChanged()) if (config.hasChanged())
@ -49,7 +49,7 @@ public class Config
@SubscribeEvent @SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
{ {
if (event.modID.equalsIgnoreCase(Lib.MODID)) if (event.getModID().equalsIgnoreCase(Lib.MODID))
initialize(); initialize();
} }
} }

View file

@ -43,16 +43,20 @@ public class ModAutoRepair extends Modifier
@SubscribeEvent(priority = EventPriority.HIGHEST) @SubscribeEvent(priority = EventPriority.HIGHEST)
public void onUpdate(PlayerEvent event) public void onUpdate(PlayerEvent event)
{ {
if (event.entityPlayer == null) if (event.getEntityPlayer() == null)
return; return;
EntityPlayer player = event.entityPlayer; EntityPlayer player = event.getEntityPlayer();
ArrayList<ItemStack> tinkersTools = new ArrayList<ItemStack>(); ArrayList<ItemStack> tinkersTools = new ArrayList<ItemStack>();
int autoRepairLevel = 0; int autoRepairLevel = 0;
for (ItemStack iterStack : player.inventory.mainInventory) for (ItemStack iterStack : player.inventory.mainInventory)
if (iterStack != null && iterStack.getItem() instanceof ToolCore) if (iterStack != null && iterStack.getItem() instanceof ToolCore)
tinkersTools.add(iterStack); tinkersTools.add(iterStack);
// Works to include items held in the second hand
if (player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() instanceof ToolCore)
tinkersTools.add(player.getHeldItemOffhand());
for (ItemStack iterStack : tinkersTools) for (ItemStack iterStack : tinkersTools)
{ {
NBTTagCompound tag = TagUtil.getToolTag(iterStack.getTagCompound()); NBTTagCompound tag = TagUtil.getToolTag(iterStack.getTagCompound());
@ -73,7 +77,7 @@ public class ModAutoRepair extends Modifier
// Calculates that the last repair time stored minus the current time is less than or equal to 30 seconds divided by auto-repair level // Calculates that the last repair time stored minus the current time is less than or equal to 30 seconds divided by auto-repair level
if ((System.currentTimeMillis() - lastRepairTime) >= (getRepairCooldown(player)) && autoRepairLevel > 0) if ((System.currentTimeMillis() - lastRepairTime) >= (getRepairCooldown(player)) && autoRepairLevel > 0)
{ {
ToolHelper.healTool(iterStack, autoRepairLevel, event.entityPlayer); ToolHelper.healTool(iterStack, autoRepairLevel, player);
tag.setLong(Lib.TAG_AUTO_REPAIR_COOLDOWN, System.currentTimeMillis()); tag.setLong(Lib.TAG_AUTO_REPAIR_COOLDOWN, System.currentTimeMillis());
} }
} }

View file

@ -22,8 +22,8 @@ import com.oitsjustjose.tinkers_addons.lib.Lib;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;