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

@ -17,7 +17,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
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
{
@Instance(Lib.MODID)

View file

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

View file

@ -43,16 +43,20 @@ public class ModAutoRepair extends Modifier
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onUpdate(PlayerEvent event)
{
if (event.entityPlayer == null)
if (event.getEntityPlayer() == null)
return;
EntityPlayer player = event.entityPlayer;
EntityPlayer player = event.getEntityPlayer();
ArrayList<ItemStack> tinkersTools = new ArrayList<ItemStack>();
int autoRepairLevel = 0;
for (ItemStack iterStack : player.inventory.mainInventory)
if (iterStack != null && iterStack.getItem() instanceof ToolCore)
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)
{
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
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());
}
}

View file

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