Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
913091d4ed | ||
|
|
5287fee25a | ||
|
|
caee2a3f52 | ||
|
|
0e0bf6a82d | ||
|
|
15b264fb70 | ||
|
|
b48f6f2a62 | ||
|
|
b899edb1e1 | ||
|
|
c2379d7df0 |
18 changed files with 199 additions and 65 deletions
|
|
@ -1,3 +1,10 @@
|
|||
1.0.2a:
|
||||
-Fixed: Server-Side Crash with Thaumium Material
|
||||
1.0.2:
|
||||
-Fixed: Auto-Repair interrupting block break / item use
|
||||
-Added: Thaumium Material (for 1.8.9 only). Stats match vanilla Thaumcraft Tools, feature can be disabled, and adds one (and only one) extra modifier when a part is made of it
|
||||
1.0.1:
|
||||
-Fixed: Auto-Repair Working on Multiple Tools Simultaneously
|
||||
1.0:
|
||||
Initial Release:
|
||||
-Added: Auto-Repair Modifier
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ repositories {
|
|||
}
|
||||
}
|
||||
|
||||
version = "1.0"
|
||||
version = "1.0.2a"
|
||||
group= "com.oitsjustjose.tinkers_addons"
|
||||
archivesBaseName = "Tinkers' Addons-1.8.9"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.oitsjustjose.tinkers_addons;
|
|||
import com.oitsjustjose.tinkers_addons.lib.Config;
|
||||
import com.oitsjustjose.tinkers_addons.lib.Lib;
|
||||
import com.oitsjustjose.tinkers_addons.lib.LibItems;
|
||||
import com.oitsjustjose.tinkers_addons.lib.LibModifiers;
|
||||
import com.oitsjustjose.tinkers_addons.lib.LibTinker;
|
||||
import com.oitsjustjose.tinkers_addons.modifiers.ModAutoRepair;
|
||||
import com.oitsjustjose.tinkers_addons.util.ClientProxy;
|
||||
import com.oitsjustjose.tinkers_addons.util.CommonProxy;
|
||||
|
|
@ -13,9 +13,11 @@ import net.minecraftforge.fml.common.Mod;
|
|||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.Mod.Instance;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import slimeknights.tconstruct.library.client.MaterialRenderInfo;
|
||||
|
||||
@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,)")
|
||||
public class TinkersAddons
|
||||
|
|
@ -27,7 +29,7 @@ public class TinkersAddons
|
|||
public static CommonProxy proxy;
|
||||
public static Config modConfig;
|
||||
public static LibItems modItems;
|
||||
public static LibModifiers modModifiers;
|
||||
public static LibTinker modTinker;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
|
|
@ -36,23 +38,25 @@ public class TinkersAddons
|
|||
|
||||
modConfig = new Config(event.getSuggestedConfigurationFile());
|
||||
modItems = new LibItems();
|
||||
modModifiers = new LibModifiers();
|
||||
modTinker = new LibTinker();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(modConfig);
|
||||
MinecraftForge.EVENT_BUS.register(new ModAutoRepair());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
if (event.getSide().isClient())
|
||||
ClientProxy.init();
|
||||
{
|
||||
initClient();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void initClient()
|
||||
{
|
||||
ClientProxy.init();
|
||||
modTinker.thaumium.setRenderInfo((new MaterialRenderInfo.Metal(0x423665, 0.1f, 0.2f, 0f)));
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.oitsjustjose.tinkers_addons.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.oitsjustjose.tinkers_addons.TinkersAddons;
|
||||
import com.oitsjustjose.tinkers_addons.lib.Lib;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
|
@ -50,9 +51,13 @@ public class ItemModMaterial extends Item
|
|||
|
||||
void registerRecipes()
|
||||
{
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 0), Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 1), "gemDiamond", "blockGold"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 2), "blockDiamond", new ItemStack(Items.golden_apple, 1, 1)));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 3), Items.nether_star, new ItemStack(Items.skull, 1, Short.MAX_VALUE)));
|
||||
if (TinkersAddons.modConfig.enableAutoRepair)
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 0), Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone, Blocks.mossy_cobblestone));
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl1)
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 1), "gemDiamond", "blockGold"));
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl2)
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 2), "blockDiamond", new ItemStack(Items.golden_apple, 1, 1)));
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl3)
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(this, 1, 3), Items.nether_star, new ItemStack(Items.skull, 1, Short.MAX_VALUE)));
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ public class Config
|
|||
public boolean enableExtraModifierLvl1;
|
||||
public boolean enableExtraModifierLvl2;
|
||||
public boolean enableExtraModifierLvl3;
|
||||
public boolean enableThaumiumToolMaterial;
|
||||
|
||||
public Config(File file)
|
||||
{
|
||||
|
|
@ -42,6 +43,10 @@ public class Config
|
|||
property.comment = "Re-adds the nether star recipe to increase modifiers on a tool if enabled";
|
||||
enableExtraModifierLvl3 = property.getBoolean();
|
||||
|
||||
property = config.get(config.CATEGORY_GENERAL, "Enable Thaumium as a Tool Material", true).setRequiresMcRestart(true);
|
||||
property.comment = "Allows tool parts to be made out of Molten Thaumium - only works if ThaumCraft is installed";
|
||||
enableThaumiumToolMaterial = property.getBoolean();
|
||||
|
||||
if (config.hasChanged())
|
||||
config.save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class Lib
|
|||
|
||||
public static final String TAG_AUTO_REPAIR = "Auto-Repair";
|
||||
public static final String TAG_AUTO_REPAIR_COOLDOWN = "Last Auto-Repair";
|
||||
public static final String TAG_REDSTONE_FLUX = "Redstone Flux";
|
||||
public static final String TAG_THAUMIUM = "thaumium_count";
|
||||
|
||||
public static final ArrayList<Item> MOD_ITEMS = new ArrayList<Item>();
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
package com.oitsjustjose.tinkers_addons.lib;
|
||||
|
||||
import com.oitsjustjose.tinkers_addons.TinkersAddons;
|
||||
import com.oitsjustjose.tinkers_addons.modifiers.ModAutoRepair;
|
||||
import com.oitsjustjose.tinkers_addons.modifiers.ModExtraModifier;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import slimeknights.mantle.util.RecipeMatch;
|
||||
import slimeknights.tconstruct.library.modifiers.Modifier;
|
||||
|
||||
public class LibModifiers
|
||||
{
|
||||
public static Modifier auto_repair;
|
||||
public static Modifier extra_modifier_lvl1;
|
||||
public static Modifier extra_modifier_lvl2;
|
||||
public static Modifier extra_modifier_lvl3;
|
||||
|
||||
public LibModifiers()
|
||||
{
|
||||
if (TinkersAddons.modConfig.enableAutoRepair)
|
||||
{
|
||||
auto_repair = new ModAutoRepair();
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl1)
|
||||
{
|
||||
extra_modifier_lvl1 = new ModExtraModifier(1);
|
||||
extra_modifier_lvl1.addRecipeMatch(new RecipeMatch.ItemCombination(1, new ItemStack(Items.diamond, 1, 0), new ItemStack(Blocks.gold_block)));
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl2)
|
||||
{
|
||||
extra_modifier_lvl2 = new ModExtraModifier(2);
|
||||
extra_modifier_lvl2.addRecipeMatch(new RecipeMatch.ItemCombination(1, new ItemStack(Items.golden_apple, 1, 1), new ItemStack(Blocks.diamond_block)));
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl3)
|
||||
{
|
||||
extra_modifier_lvl3 = new ModExtraModifier(3);
|
||||
extra_modifier_lvl3.addItem(Items.nether_star);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.oitsjustjose.tinkers_addons.lib;
|
||||
|
||||
import com.oitsjustjose.tinkers_addons.TinkersAddons;
|
||||
import com.oitsjustjose.tinkers_addons.modifiers.ModAutoRepair;
|
||||
import com.oitsjustjose.tinkers_addons.modifiers.ModExtraModifier;
|
||||
import com.oitsjustjose.tinkers_addons.modifiers.TraitOccult;
|
||||
import com.oitsjustjose.tinkers_addons.util.InterModUtils;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import slimeknights.mantle.util.RecipeMatch;
|
||||
import slimeknights.tconstruct.library.TinkerRegistry;
|
||||
import slimeknights.tconstruct.library.client.MaterialRenderInfo;
|
||||
import slimeknights.tconstruct.library.materials.ExtraMaterialStats;
|
||||
import slimeknights.tconstruct.library.materials.HandleMaterialStats;
|
||||
import slimeknights.tconstruct.library.materials.HeadMaterialStats;
|
||||
import slimeknights.tconstruct.library.materials.Material;
|
||||
import slimeknights.tconstruct.library.modifiers.Modifier;
|
||||
import slimeknights.tconstruct.library.utils.HarvestLevels;
|
||||
|
||||
public class LibTinker
|
||||
{
|
||||
public static Modifier auto_repair;
|
||||
public static Modifier extra_modifier_lvl1;
|
||||
public static Modifier extra_modifier_lvl2;
|
||||
public static Modifier extra_modifier_lvl3;
|
||||
public static Material thaumium;
|
||||
|
||||
public LibTinker()
|
||||
{
|
||||
if (TinkersAddons.modConfig.enableAutoRepair)
|
||||
{
|
||||
auto_repair = new ModAutoRepair();
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl1)
|
||||
{
|
||||
extra_modifier_lvl1 = new ModExtraModifier(1);
|
||||
extra_modifier_lvl1.addRecipeMatch(new RecipeMatch.ItemCombination(1, new ItemStack(Items.diamond, 1, 0), new ItemStack(Blocks.gold_block)));
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl2)
|
||||
{
|
||||
extra_modifier_lvl2 = new ModExtraModifier(2);
|
||||
extra_modifier_lvl2.addRecipeMatch(new RecipeMatch.ItemCombination(1, new ItemStack(Items.golden_apple, 1, 1), new ItemStack(Blocks.diamond_block)));
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl3)
|
||||
{
|
||||
extra_modifier_lvl3 = new ModExtraModifier(3);
|
||||
extra_modifier_lvl3.addItem(Items.nether_star);
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableThaumiumToolMaterial)
|
||||
{
|
||||
thaumium = new Material("thaumium", 0x423665);
|
||||
thaumium.setCraftable(true);
|
||||
thaumium.addItem("ingotThaumium", 1, Material.VALUE_Ingot);
|
||||
thaumium.addItem("nuggetThaumium", 1, Material.VALUE_Nugget);
|
||||
thaumium.addItem(TinkerRegistry.getShard(thaumium), 1, Material.VALUE_Shard);
|
||||
thaumium.setRepresentativeItem(InterModUtils.getFirstFromOreDict("ingotThaumium"));
|
||||
thaumium.addTrait(new TraitOccult());
|
||||
thaumium.setShard(TinkerRegistry.getShard(thaumium));
|
||||
TinkerRegistry.addMaterialStats(thaumium, new HeadMaterialStats(400, 5.00f, 3.50f, HarvestLevels.DIAMOND), new HandleMaterialStats(1.0f, 60), new ExtraMaterialStats(40));
|
||||
TinkerRegistry.addMaterial(thaumium);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,13 +48,14 @@ public class ModAutoRepair extends Modifier
|
|||
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
ArrayList<ItemStack> tinkersTools = new ArrayList<ItemStack>();
|
||||
int autoRepairLevel = 0;
|
||||
int autoRepairLevel;
|
||||
for (ItemStack iterStack : player.inventory.mainInventory)
|
||||
if (iterStack != null && iterStack.getItem() instanceof ToolCore)
|
||||
tinkersTools.add(iterStack);
|
||||
|
||||
for (ItemStack iterStack : tinkersTools)
|
||||
{
|
||||
autoRepairLevel = 0;
|
||||
NBTTagCompound tag = TagUtil.getToolTag(iterStack.getTagCompound());
|
||||
NBTTagList tagList = TagUtil.getModifiersTagList(iterStack);
|
||||
for (int i = 0; i < tagList.tagCount(); i++)
|
||||
|
|
@ -68,10 +69,9 @@ public class ModAutoRepair extends Modifier
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
long lastRepairTime = tag.getLong(Lib.TAG_AUTO_REPAIR_COOLDOWN);
|
||||
// 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 (autoRepairLevel > 0 && (System.currentTimeMillis() - lastRepairTime) >= (getRepairCooldown(player)) && !player.isSwingInProgress)
|
||||
{
|
||||
ToolHelper.healTool(iterStack, autoRepairLevel, event.entityPlayer);
|
||||
tag.setLong(Lib.TAG_AUTO_REPAIR_COOLDOWN, System.currentTimeMillis());
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class ModExtraModifier extends Modifier
|
|||
public ModExtraModifier(int level)
|
||||
{
|
||||
super("bonus-modifier_" + level);
|
||||
this.addAspects(new ModifierAspect.SingleAspect(this), new ModifierAspect.DataAspect(this, 0x8cf4e2));
|
||||
this.addAspects(new ModifierAspect.SingleAspect(this), new ModifierAspect.DataAspect(this, 0xFFFFFF));
|
||||
this.addItem(new ItemStack(TinkersAddons.modItems.materials, 1, level), 1, 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.oitsjustjose.tinkers_addons.modifiers;
|
||||
|
||||
import com.oitsjustjose.tinkers_addons.lib.Lib;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import slimeknights.tconstruct.library.tools.ToolNBT;
|
||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||
|
||||
public class TraitOccult extends AbstractTrait
|
||||
{
|
||||
public TraitOccult()
|
||||
{
|
||||
super("occult", 0x423665);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyEffect(NBTTagCompound rootCompound, NBTTagCompound modifierTag)
|
||||
{
|
||||
ToolNBT data = TagUtil.getToolStats(rootCompound);
|
||||
|
||||
// Increases the total modifiers by one only if it doesn't already have the tag that it's been done
|
||||
if (!(rootCompound.getInteger(Lib.TAG_THAUMIUM) >= 1))
|
||||
{
|
||||
data.modifiers++;
|
||||
rootCompound.setInteger(Lib.TAG_THAUMIUM, 1);
|
||||
}
|
||||
TagUtil.setToolTag(rootCompound, data.get());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.oitsjustjose.tinkers_addons.util;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class InterModUtils
|
||||
{
|
||||
/**
|
||||
* @param oreDict
|
||||
* The oreDict name of the ItemStack you want
|
||||
* @return the first entry from the oreDictionary if it's present, null otherwise
|
||||
*/
|
||||
public static ItemStack getFirstFromOreDict(String oreDict)
|
||||
{
|
||||
if (OreDictionary.getOres(oreDict).size() > 0)
|
||||
return OreDictionary.getOres(oreDict).get(0);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param modid
|
||||
* modid to search for
|
||||
* @param item
|
||||
* item or block to search for
|
||||
* @return a new itemstack with the block or item for
|
||||
*/
|
||||
public static ItemStack findItemStack(String modid, String item)
|
||||
{
|
||||
ResourceLocation location = new ResourceLocation(modid, item);
|
||||
|
||||
if (Item.itemRegistry.containsKey(location))
|
||||
return new ItemStack(Item.itemRegistry.getObject(location));
|
||||
else if (Block.blockRegistry.containsKey(location))
|
||||
return new ItemStack(Block.blockRegistry.getObject(location));
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,4 +9,9 @@ modifier.auto-repair.name=Auto-Repair
|
|||
modifier.bonus-modifier_1.name=Diamond Bonus Modifier
|
||||
modifier.bonus-modifier_2.name=Notch Apple Bonus Modifier
|
||||
modifier.bonus-modifier_3.name=Nether Star Bonus Modifier
|
||||
modifier.auto-repair.desc=§oFree Repair Like the Old Days §r\nYou didn't realize you missed this, did you?
|
||||
modifier.auto-repair.desc=§oBringing life back where you wouldn't expect §r\nThis moss seems to enjoy sunny days, but the musty nether is nice too..
|
||||
modifier.occult.name=Occult
|
||||
modifier.occult.desc=§oInfused with Vis §r\nThe power of Praecantic Thaumium boosts your modifier count by 1 (max 1 per tool).
|
||||
|
||||
#Materials
|
||||
material.thaumium.name=Thaumium
|
||||
|
|
@ -2,5 +2,17 @@
|
|||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "tinkersaddons:items/extra_modifier_lvl1"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ -90, 0, 0 ],
|
||||
"translation": [ 0, 1, -3 ],
|
||||
"scale": [ 0.55, 0.55, 0.55 ]
|
||||
},
|
||||
"firstperson": {
|
||||
"rotation": [ 0, -135, 25 ],
|
||||
"translation": [ 0, 4, 2 ],
|
||||
"scale": [ 1.7, 1.7, 1.7 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.1 KiB |
Loading…
Reference in a new issue