Haven't updated in unreasonably long
This commit is contained in:
parent
6a06ab7a59
commit
9aa4375cb6
7 changed files with 20 additions and 114 deletions
|
|
@ -2,7 +2,6 @@ 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;
|
||||
|
|
@ -29,7 +28,7 @@ public class ItemModMaterial extends Item
|
|||
@Override
|
||||
public boolean hasEffect(ItemStack itemstack)
|
||||
{
|
||||
return (itemstack.getItemDamage() == 0 && TinkersAddons.modConfig.autoRepairRecipeType == 2) ? true : itemstack.getItemDamage() == 4 ? false : itemstack.getItemDamage() >= 2 ? true : false;
|
||||
return itemstack.getItemDamage() == 0 ? true : itemstack.getItemDamage() == 4 ? false : itemstack.getItemDamage() >= 2 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public class Config
|
|||
{
|
||||
public Configuration config;
|
||||
|
||||
public int autoRepairRecipeType;
|
||||
public boolean enableAmelioration;
|
||||
public boolean enableExtraModifierLvl1;
|
||||
public boolean enableExtraModifierLvl2;
|
||||
public boolean enableExtraModifierLvl3;
|
||||
|
|
@ -27,10 +27,10 @@ public class Config
|
|||
{
|
||||
Property property;
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "Auto-Repair Recipe Type", 2).setRequiresMcRestart(true);
|
||||
property.setComment("Allows you to modify the auto-repair recipe. 0 disables the feature, 1 enables the easier recipe, 2 enables a harder one.");
|
||||
autoRepairRecipeType = property.getInt();
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "Enable Amelioration Kit mod for tools", true).setRequiresMcRestart(true);
|
||||
property.setComment("Amelioration Kits are the method of getting Pre-TiCon 2 auto-repair");
|
||||
enableAmelioration = property.getBoolean();
|
||||
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -14,10 +14,9 @@ public class LibModifiers
|
|||
public Modifier extra_modifier_lvl3;
|
||||
public Modifier extra_modifier_lvl4;
|
||||
|
||||
|
||||
public LibModifiers()
|
||||
{
|
||||
if (TinkersAddons.modConfig.autoRepairRecipeType > 0)
|
||||
if (TinkersAddons.modConfig.enableAmelioration)
|
||||
{
|
||||
auto_repair = new ModAutoRepair();
|
||||
}
|
||||
|
|
@ -33,7 +32,7 @@ public class LibModifiers
|
|||
{
|
||||
extra_modifier_lvl3 = new ModExtraModifier(3);
|
||||
}
|
||||
if(TinkersAddons.modConfig.enableExtraModifierLvl4)
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl4)
|
||||
{
|
||||
extra_modifier_lvl4 = new ModExtraModifier(4);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,86 +0,0 @@
|
|||
package com.oitsjustjose.tinkers_addons.util;
|
||||
|
||||
import com.oitsjustjose.tinkers_addons.TinkersAddons;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemEnchantedBook;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.RecipesMapCloning;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ModRecipeAmelioration extends RecipesMapCloning
|
||||
{
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting invCraft, World world)
|
||||
{
|
||||
boolean mending = false;
|
||||
int numMoss = 0;
|
||||
|
||||
for (int x = 0; x < 3; x++)
|
||||
{
|
||||
for (int y = 0; y < 3; y++)
|
||||
{
|
||||
ItemStack temp = invCraft.getStackInRowAndColumn(x, y);
|
||||
if (temp == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Checks for center item slot
|
||||
if (x == 1 && y == 1)
|
||||
{
|
||||
if (temp.getItem() instanceof ItemEnchantedBook)
|
||||
{
|
||||
if (temp.getTagCompound() != null)
|
||||
{
|
||||
NBTTagCompound comp = temp.getTagCompound();
|
||||
mending = comp.getTag("StoredEnchantments").toString().contains("id:70s");
|
||||
}
|
||||
}
|
||||
// Checks if the center item slot has mending on it
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.getEnchantmentByID(70), temp) > 0)
|
||||
mending = true;
|
||||
}
|
||||
// Else not the center slot it drops out if the block isn't mossy cobble
|
||||
else if ((temp.getItem() == Item.getItemFromBlock(Blocks.MOSSY_COBBLESTONE)))
|
||||
{
|
||||
++numMoss;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return mending && numMoss == 8;
|
||||
}
|
||||
|
||||
// DONE
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting invCraft)
|
||||
{
|
||||
return new ItemStack(TinkersAddons.modItems.materials, 1, 0);
|
||||
}
|
||||
|
||||
// DONE
|
||||
@Override
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
// DONE
|
||||
@Override
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems(InventoryCrafting invCraft)
|
||||
{
|
||||
return new ItemStack[] { null, null, null, null, null, null, null, null, null };
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +1,28 @@
|
|||
package com.oitsjustjose.tinkers_addons.util;
|
||||
|
||||
import com.oitsjustjose.tinkers_addons.TinkersAddons;
|
||||
import com.oitsjustjose.tinkers_addons.lib.Lib;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import slimeknights.tconstruct.shared.TinkerCommons;
|
||||
|
||||
public class ModRecipes
|
||||
{
|
||||
public ModRecipes()
|
||||
{
|
||||
registerAutoRepairRecipe();
|
||||
registerBonusModRecipes();
|
||||
}
|
||||
|
||||
public void registerAutoRepairRecipe()
|
||||
{
|
||||
if (TinkersAddons.modConfig.autoRepairRecipeType == 1)
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 0), new Object[] { "MMM", "MEM", "MMM", 'M', Blocks.MOSSY_COBBLESTONE, 'E', Items.BOOK });
|
||||
}
|
||||
else if (TinkersAddons.modConfig.autoRepairRecipeType == 2)
|
||||
{
|
||||
CraftingManager.getInstance().getRecipeList().add(new ModRecipeAmelioration());
|
||||
RecipeSorter.register(Lib.MODID + ":Amelioration", ModRecipeAmelioration.class, Category.SHAPED, "");
|
||||
}
|
||||
}
|
||||
|
||||
public void registerBonusModRecipes()
|
||||
{
|
||||
if (TinkersAddons.modConfig.enableAmelioration)
|
||||
{
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 0), new Object[] { new ItemStack(TinkerCommons.materials, 1, 19), new ItemStack(TinkerCommons.materials, 1, 19), new ItemStack(TinkerCommons.materials, 1, 19), Items.BOOK }));
|
||||
}
|
||||
if (TinkersAddons.modConfig.enableExtraModifierLvl1)
|
||||
{
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 1), "gemDiamond", "blockGold"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue