mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Added Thermal Foundation Paxels
This commit is contained in:
parent
5e943b4b67
commit
abb8e122d9
15 changed files with 141 additions and 42 deletions
|
@ -16,6 +16,7 @@ import ellpeck.actuallyadditions.event.InitEvents;
|
|||
import ellpeck.actuallyadditions.gen.InitVillager;
|
||||
import ellpeck.actuallyadditions.gen.OreGen;
|
||||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||
import ellpeck.actuallyadditions.items.InitForeignPaxels;
|
||||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.items.ItemCoffee;
|
||||
import ellpeck.actuallyadditions.material.InitArmorMaterials;
|
||||
|
@ -84,6 +85,7 @@ public class ActuallyAdditions{
|
|||
ItemCrafting.initMashedFoodRecipes();
|
||||
HairyBallHandler.init();
|
||||
TreasureChestHandler.init();
|
||||
InitForeignPaxels.init();
|
||||
proxy.postInit();
|
||||
|
||||
ModUtil.LOGGER.info("PostInitialization Finished.");
|
||||
|
|
|
@ -27,6 +27,8 @@ public enum ConfigBoolValues{
|
|||
DO_CRUSHER_SPAM("Crusher Debug", ConfigCategories.OTHER, false, "Print out Crusher Recipe Initializing Debug"),
|
||||
DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion"),
|
||||
|
||||
TF_PAXELS("Thermal Foundation Paxels", ConfigCategories.OTHER, true, "If Paxels made of Thermal Foundation Materials should exist"),
|
||||
|
||||
DO_RICE_GEN("Rice Gen", ConfigCategories.WORLD_GEN, true, "If Rice should generate in the World"),
|
||||
DO_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"),
|
||||
DO_FLAX_GEN("Flax Gen", ConfigCategories.WORLD_GEN, true, "If Flax should generate in the World"),
|
||||
|
|
|
@ -90,6 +90,7 @@ public enum ConfigCrafting{
|
|||
CUP("Cup", ConfigCategories.ITEMS_CRAFTING),
|
||||
PAXELS("Paxels", ConfigCategories.ITEMS_CRAFTING),
|
||||
|
||||
|
||||
ENDER_CASING("Ender Casing", ConfigCategories.BLOCKS_CRAFTING),
|
||||
PHANTOM_BOOSTER("Phantom Booster", ConfigCategories.BLOCKS_CRAFTING),
|
||||
COFFEE_MACHINE("Coffee Machine", ConfigCategories.BLOCKS_CRAFTING),
|
||||
|
|
|
@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.creative;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.items.InitForeignPaxels;
|
||||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -117,6 +118,7 @@ public class CreativeTab extends CreativeTabs{
|
|||
add(InitItems.diamondPaxel);
|
||||
add(InitItems.emeraldPaxel);
|
||||
add(InitItems.obsidianPaxel);
|
||||
InitForeignPaxels.addToCreativeTab(this.list);
|
||||
|
||||
add(InitItems.itemPickaxeEmerald);
|
||||
add(InitItems.itemSwordEmerald);
|
||||
|
@ -157,10 +159,10 @@ public class CreativeTab extends CreativeTabs{
|
|||
}
|
||||
|
||||
private void add(Item item){
|
||||
item.getSubItems(item, instance, list);
|
||||
item.getSubItems(item, instance, this.list);
|
||||
}
|
||||
|
||||
private void add(Block block){
|
||||
block.getSubBlocks(new ItemStack(block).getItem(), instance, list);
|
||||
block.getSubBlocks(new ItemStack(block).getItem(), instance, this.list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package ellpeck.actuallyadditions.items;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
||||
import ellpeck.actuallyadditions.creative.CreativeTab;
|
||||
import ellpeck.actuallyadditions.items.tools.ItemAllToolAA;
|
||||
import ellpeck.actuallyadditions.util.ItemUtil;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InitForeignPaxels{
|
||||
|
||||
private static Item[] foreignPaxels = new Item[9];
|
||||
private static final String[] names = new String[]{"Copper", "Tin", "Silver", "Lead", "Nickel", "Electrum", "Bronze", "Platinum", "Invar"};
|
||||
|
||||
public static void init(){
|
||||
if(ConfigBoolValues.TF_PAXELS.isEnabled() && Loader.isModLoaded("ThermalFoundation")){
|
||||
ModUtil.LOGGER.info("Initializing Thermal Foundation Material Paxels...");
|
||||
|
||||
for(int i = 0; i < foreignPaxels.length; i++){
|
||||
Item axe = ItemUtil.getItemFromName("ThermalFoundation:tool.axe"+names[i]);
|
||||
Item pickaxe = ItemUtil.getItemFromName("ThermalFoundation:tool.pickaxe"+names[i]);
|
||||
Item hoe = ItemUtil.getItemFromName("ThermalFoundation:tool.hoe"+names[i]);
|
||||
Item sword = ItemUtil.getItemFromName("ThermalFoundation:tool.sword"+names[i]);
|
||||
Item shovel = ItemUtil.getItemFromName("ThermalFoundation:tool.shovel"+names[i]);
|
||||
|
||||
if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){
|
||||
Item.ToolMaterial material = ((ItemTool)axe).func_150913_i();
|
||||
foreignPaxels[i] = new ItemAllToolAA(material, "ingot"+names[i], "paxel"+names[i], EnumRarity.rare);
|
||||
ItemUtil.register(foreignPaxels[i]);
|
||||
|
||||
if(ConfigCrafting.PAXELS.isEnabled()){
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(foreignPaxels[i], axe, pickaxe, hoe, sword, shovel));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else ModUtil.LOGGER.info("Thermal Foundation not loaded, can't initialize special Paxels.");
|
||||
}
|
||||
|
||||
public static void addToCreativeTab(List list){
|
||||
for(Item item : foreignPaxels){
|
||||
if(item != null){
|
||||
item.getSubItems(item, CreativeTab.instance, list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -203,27 +203,27 @@ public class InitItems{
|
|||
ItemUtil.register(itemCoffeeSeed);
|
||||
CompatUtil.registerMFRSeed(itemCoffeeSeed);
|
||||
|
||||
itemPickaxeEmerald = new ItemPickaxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.rare);
|
||||
itemAxeEmerald = new ItemAxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.rare);
|
||||
itemShovelEmerald = new ItemShovelAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.rare);
|
||||
itemSwordEmerald = new ItemSwordAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemSwordEmerald", EnumRarity.rare);
|
||||
itemHoeEmerald = new ItemHoeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemHoeEmerald", EnumRarity.rare);
|
||||
itemPickaxeEmerald = new ItemPickaxeAA(InitToolMaterials.toolMaterialEmerald, "gemEmerald", "itemPickaxeEmerald", EnumRarity.rare);
|
||||
itemAxeEmerald = new ItemAxeAA(InitToolMaterials.toolMaterialEmerald, "gemEmerald", "itemAxeEmerald", EnumRarity.rare);
|
||||
itemShovelEmerald = new ItemShovelAA(InitToolMaterials.toolMaterialEmerald, "gemEmerald", "itemShovelEmerald", EnumRarity.rare);
|
||||
itemSwordEmerald = new ItemSwordAA(InitToolMaterials.toolMaterialEmerald, "gemEmerald", "itemSwordEmerald", EnumRarity.rare);
|
||||
itemHoeEmerald = new ItemHoeAA(InitToolMaterials.toolMaterialEmerald, "gemEmerald", "itemHoeEmerald", EnumRarity.rare);
|
||||
ItemUtil.registerItems(new Item[]{itemPickaxeEmerald, itemAxeEmerald, itemShovelEmerald, itemSwordEmerald, itemHoeEmerald});
|
||||
|
||||
itemPickaxeObsidian = new ItemPickaxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemPickaxeObsidian", EnumRarity.uncommon);
|
||||
itemAxeObsidian = new ItemAxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemAxeObsidian", EnumRarity.uncommon);
|
||||
itemShovelObsidian = new ItemShovelAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemShovelObsidian", EnumRarity.uncommon);
|
||||
itemSwordObsidian = new ItemSwordAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemSwordObsidian", EnumRarity.uncommon);
|
||||
itemHoeObsidian = new ItemHoeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemHoeObsidian", EnumRarity.uncommon);
|
||||
itemPickaxeObsidian = new ItemPickaxeAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "itemPickaxeObsidian", EnumRarity.uncommon);
|
||||
itemAxeObsidian = new ItemAxeAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "itemAxeObsidian", EnumRarity.uncommon);
|
||||
itemShovelObsidian = new ItemShovelAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "itemShovelObsidian", EnumRarity.uncommon);
|
||||
itemSwordObsidian = new ItemSwordAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "itemSwordObsidian", EnumRarity.uncommon);
|
||||
itemHoeObsidian = new ItemHoeAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "itemHoeObsidian", EnumRarity.uncommon);
|
||||
ItemUtil.registerItems(new Item[]{itemPickaxeObsidian, itemAxeObsidian, itemShovelObsidian, itemSwordObsidian, itemHoeObsidian});
|
||||
|
||||
woodenPaxel = new ItemAllToolAA(Item.ToolMaterial.WOOD, new ItemStack(Blocks.planks), "woodenPaxel", EnumRarity.uncommon);
|
||||
stonePaxel = new ItemAllToolAA(Item.ToolMaterial.STONE, new ItemStack(Blocks.stone), "stonePaxel", EnumRarity.uncommon);
|
||||
ironPaxel = new ItemAllToolAA(Item.ToolMaterial.IRON, new ItemStack(Items.iron_ingot), "ironPaxel", EnumRarity.rare);
|
||||
goldPaxel = new ItemAllToolAA(Item.ToolMaterial.GOLD, new ItemStack(Items.gold_ingot), "goldPaxel", EnumRarity.rare);
|
||||
diamondPaxel = new ItemAllToolAA(Item.ToolMaterial.EMERALD, new ItemStack(Items.diamond), "diamondPaxel", EnumRarity.epic);
|
||||
emeraldPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "emeraldPaxel", EnumRarity.epic);
|
||||
obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "obsidianPaxel", EnumRarity.epic);
|
||||
woodenPaxel = new ItemAllToolAA(Item.ToolMaterial.WOOD, "plankWood", "woodenPaxel", EnumRarity.uncommon);
|
||||
stonePaxel = new ItemAllToolAA(Item.ToolMaterial.STONE, "stone", "stonePaxel", EnumRarity.uncommon);
|
||||
ironPaxel = new ItemAllToolAA(Item.ToolMaterial.IRON, "ingotIron", "ironPaxel", EnumRarity.rare);
|
||||
goldPaxel = new ItemAllToolAA(Item.ToolMaterial.GOLD, "ingotGold", "goldPaxel", EnumRarity.rare);
|
||||
diamondPaxel = new ItemAllToolAA(Item.ToolMaterial.EMERALD, "gemDiamond", "diamondPaxel", EnumRarity.epic);
|
||||
emeraldPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialEmerald, "gemEmerald", "emeraldPaxel", EnumRarity.epic);
|
||||
obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "obsidianPaxel", EnumRarity.epic);
|
||||
ItemUtil.registerItems(new Item[]{woodenPaxel, stonePaxel, ironPaxel, goldPaxel, diamondPaxel, emeraldPaxel, obsidianPaxel});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import net.minecraft.util.StatCollector;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -42,9 +43,9 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{
|
|||
|
||||
private String name;
|
||||
private EnumRarity rarity;
|
||||
private ItemStack repairItem;
|
||||
private String repairItem;
|
||||
|
||||
public ItemAllToolAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
super(5.0F, toolMat, allSet);
|
||||
|
||||
this.repairItem = repairItem;
|
||||
|
@ -102,7 +103,11 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return stack.getItem() == repairItem.getItem();
|
||||
int[] idsStack = OreDictionary.getOreIDs(stack);
|
||||
for(int id : idsStack){
|
||||
if(OreDictionary.getOreName(id).equals(repairItem)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.item.ItemAxe;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,9 +21,9 @@ public class ItemAxeAA extends ItemAxe implements INameableItem{
|
|||
|
||||
private String name;
|
||||
private EnumRarity rarity;
|
||||
private ItemStack repairItem;
|
||||
private String repairItem;
|
||||
|
||||
public ItemAxeAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
public ItemAxeAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
super(toolMat);
|
||||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
|
@ -42,7 +43,11 @@ public class ItemAxeAA extends ItemAxe implements INameableItem{
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return stack.getItem() == repairItem.getItem();
|
||||
int[] idsStack = OreDictionary.getOreIDs(stack);
|
||||
for(int id : idsStack){
|
||||
if(OreDictionary.getOreName(id).equals(repairItem)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.item.ItemHoe;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,9 +22,9 @@ public class ItemHoeAA extends ItemHoe implements INameableItem{
|
|||
private String name;
|
||||
private String oredictName;
|
||||
private EnumRarity rarity;
|
||||
private ItemStack repairItem;
|
||||
private String repairItem;
|
||||
|
||||
public ItemHoeAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
public ItemHoeAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
super(toolMat);
|
||||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
|
@ -44,7 +45,11 @@ public class ItemHoeAA extends ItemHoe implements INameableItem{
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return stack.getItem() == repairItem.getItem();
|
||||
int[] idsStack = OreDictionary.getOreIDs(stack);
|
||||
for(int id : idsStack){
|
||||
if(OreDictionary.getOreName(id).equals(repairItem)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.item.ItemPickaxe;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,9 +22,9 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{
|
|||
private String name;
|
||||
private String oredictName;
|
||||
private EnumRarity rarity;
|
||||
private ItemStack repairItem;
|
||||
private String repairItem;
|
||||
|
||||
public ItemPickaxeAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
public ItemPickaxeAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
super(toolMat);
|
||||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
|
@ -44,7 +45,11 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return stack.getItem() == repairItem.getItem();
|
||||
int[] idsStack = OreDictionary.getOreIDs(stack);
|
||||
for(int id : idsStack){
|
||||
if(OreDictionary.getOreName(id).equals(repairItem)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -67,8 +72,4 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{
|
|||
public String getName(){
|
||||
return name;
|
||||
}
|
||||
|
||||
private String getOredictName(){
|
||||
return oredictName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.item.ItemSpade;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,9 +22,9 @@ public class ItemShovelAA extends ItemSpade implements INameableItem{
|
|||
private String name;
|
||||
private String oredictName;
|
||||
private EnumRarity rarity;
|
||||
private ItemStack repairItem;
|
||||
private String repairItem;
|
||||
|
||||
public ItemShovelAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
public ItemShovelAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
super(toolMat);
|
||||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
|
@ -44,7 +45,11 @@ public class ItemShovelAA extends ItemSpade implements INameableItem{
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return stack.getItem() == repairItem.getItem();
|
||||
int[] idsStack = OreDictionary.getOreIDs(stack);
|
||||
for(int id : idsStack){
|
||||
if(OreDictionary.getOreName(id).equals(repairItem)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,9 +22,9 @@ public class ItemSwordAA extends ItemSword implements INameableItem{
|
|||
private String name;
|
||||
private String oredictName;
|
||||
private EnumRarity rarity;
|
||||
private ItemStack repairItem;
|
||||
private String repairItem;
|
||||
|
||||
public ItemSwordAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
public ItemSwordAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity){
|
||||
super(toolMat);
|
||||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
|
@ -44,7 +45,11 @@ public class ItemSwordAA extends ItemSword implements INameableItem{
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return stack.getItem() == repairItem.getItem();
|
||||
int[] idsStack = OreDictionary.getOreIDs(stack);
|
||||
for(int id : idsStack){
|
||||
if(OreDictionary.getOreName(id).equals(repairItem)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
|||
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -19,6 +20,10 @@ public class InitOreDict{
|
|||
public static void init(){
|
||||
ModUtil.LOGGER.info("Initializing OreDictionary Entries...");
|
||||
|
||||
//Vanilla Ores
|
||||
addOre(Blocks.obsidian, "obsidian");
|
||||
|
||||
//My Ores
|
||||
addOre(InitItems.itemDust, TheDusts.IRON.ordinal(), "dustIron");
|
||||
addOre(InitItems.itemDust, TheDusts.GOLD.ordinal(), "dustGold");
|
||||
addOre(InitItems.itemDust, TheDusts.DIAMOND.ordinal(), "dustDiamond");
|
||||
|
|
|
@ -19,6 +19,13 @@ public class ItemUtil{
|
|||
else list.add(shiftForInfo());
|
||||
}
|
||||
|
||||
public static Item getItemFromName(String name){
|
||||
if(Item.itemRegistry.containsKey(name)){
|
||||
return (Item)Item.itemRegistry.getObject(name);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void registerItems(Item[] items){
|
||||
for(Item item : items){
|
||||
register(item);
|
||||
|
|
|
@ -366,7 +366,6 @@ tooltip.actuallyadditions.noEffects.desc=No Effects
|
|||
|
||||
tooltip.actuallyadditions.oredictName.desc=OreDictionary Entries
|
||||
tooltip.actuallyadditions.noOredictNameAvail.desc=Has No OreDictionary Entries
|
||||
tooltip.actuallyadditions.itemName.desc=
|
||||
|
||||
tooltip.actuallyadditions.itemJam.desc.1=A delicious Jam consisting of
|
||||
tooltip.actuallyadditions.itemJam.desc.2=Also gives you some Effects!
|
||||
|
|
Loading…
Reference in a new issue