From f70e6e757c140ddd905811622c6fcd3b940c5a19 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Thu, 11 Dec 2014 08:53:31 +0800 Subject: [PATCH] Fixed creative tab icon --- .../resonantinduction/archaic/ArchaicContent.scala | 1 + .../archaic/blocks/ItemImprint.scala | 2 +- .../resonantinduction/atomic/AtomicContent.scala | 13 ++++++++----- .../atomic/items/ItemAntimatter.scala | 2 +- .../resonantinduction/atomic/items/ItemCell.scala | 2 +- .../atomic/items/ItemFissileFuel.scala | 2 +- .../resonantinduction/atomic/items/ItemHazmat.scala | 2 +- .../resonantinduction/core/RICreativeTab.scala | 13 +------------ .../resonantinduction/core/ResonantInduction.scala | 2 -- .../mechanical/MechanicalContent.scala | 2 -- 10 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/main/scala/resonantinduction/archaic/ArchaicContent.scala b/src/main/scala/resonantinduction/archaic/ArchaicContent.scala index dd636b69e..b30e474b2 100644 --- a/src/main/scala/resonantinduction/archaic/ArchaicContent.scala +++ b/src/main/scala/resonantinduction/archaic/ArchaicContent.scala @@ -47,6 +47,7 @@ object ArchaicContent extends ContentHolder { OreDictionary.registerOre("cobblestone", Blocks.cobblestone) } + if (OreDictionary.getOres("stickWood") == null) { OreDictionary.registerOre("stickWood", Items.stick) diff --git a/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala b/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala index a3311037e..1b05238a8 100644 --- a/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala +++ b/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala @@ -92,7 +92,7 @@ class ItemImprint extends Item //Constructor setUnlocalizedName(Reference.prefix + "imprint") setTextureName(Reference.prefix + "imprint") - setCreativeTab(RICreativeTab.tab) + setCreativeTab(RICreativeTab) setHasSubtypes(true) setMaxStackSize(1) diff --git a/src/main/scala/resonantinduction/atomic/AtomicContent.scala b/src/main/scala/resonantinduction/atomic/AtomicContent.scala index 0cfdbf7d4..286173293 100644 --- a/src/main/scala/resonantinduction/atomic/AtomicContent.scala +++ b/src/main/scala/resonantinduction/atomic/AtomicContent.scala @@ -135,7 +135,7 @@ object AtomicContent extends ContentHolder PacketAnnotationManager.INSTANCE.register(classOf[TileAccelerator]) //Buckets - itemBucketToxic = manager.newItem("bucketToxicWaste", new ItemBucket(AtomicContent.blockPlasma)).setCreativeTab(RICreativeTab.tab).setContainerItem(Items.bucket).setTextureName(Reference.prefix + "bucketToxicWaste") + itemBucketToxic = manager.newItem("bucketToxicWaste", new ItemBucket(AtomicContent.blockPlasma)).setCreativeTab(RICreativeTab).setContainerItem(Items.bucket).setTextureName(Reference.prefix + "bucketToxicWaste") //Schematics SchematicRegistry.register("resonantInduction.atomic.accelerator", new SchematicAccelerator) @@ -191,27 +191,29 @@ object AtomicContent extends ContentHolder } }) Settings.config.save - RICreativeTab.itemStack(new ItemStack(AtomicContent.blockReactorCell)) } override def postInit() { super.postInit() + if (Loader.isModLoaded("IC2") && Settings.allowAlternateRecipes) { OreDictionary.registerOre("cellEmpty", IC2Items.getItem("cell")) val cellEmptyName: String = OreDictionary.getOreName(OreDictionary.getOreID("cellEmpty")) - if (cellEmptyName eq "Unknown") + if (cellEmptyName == "Unknown") { } GameRegistry.addRecipe(new ShapelessOreRecipe(AtomicContent.itemYellowCake, IC2Items.getItem("reactorUraniumSimple"))) GameRegistry.addRecipe(new ShapelessOreRecipe(IC2Items.getItem("cell"), AtomicContent.itemCell)) GameRegistry.addRecipe(new ShapelessOreRecipe(AtomicContent.itemCell, "cellEmpty")) } + EntityRegistry.registerGlobalEntityID(classOf[EntityParticle], "ASParticle", EntityRegistry.findGlobalUniqueEntityId) EntityRegistry.registerModEntity(classOf[EntityParticle], "ASParticle", ENTITY_ID_PREFIX, ResonantInduction, 80, 3, true) - Settings.config.load + Settings.config.load() + for (oreName <- OreDictionary.getOreNames) { if (oreName.startsWith("ingot")) @@ -225,7 +227,8 @@ object AtomicContent extends ContentHolder } } } - Settings.config.save + + Settings.config.save() recipes += shapeless(new ItemStack(itemAntimatter, 1, 1), itemAntimatter, itemAntimatter, itemAntimatter, itemAntimatter, itemAntimatter, AtomicContent.itemAntimatter, itemAntimatter, itemAntimatter) recipes += shapeless(new ItemStack(itemAntimatter, 8, 0), new ItemStack(AtomicContent.itemAntimatter, 1, 1)) diff --git a/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.scala b/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.scala index ef3d5c1c9..006a017fd 100644 --- a/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.scala +++ b/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.scala @@ -23,7 +23,7 @@ class ItemAntimatter extends ItemCell this.setHasSubtypes(true) this.setUnlocalizedName(Reference.prefix + "antimatter") this.setTextureName(Reference.prefix + "antimatter") - setCreativeTab(RICreativeTab.tab) + setCreativeTab(RICreativeTab) @SideOnly(Side.CLIENT) override def registerIcons(iconRegister: IIconRegister) { diff --git a/src/main/scala/resonantinduction/atomic/items/ItemCell.scala b/src/main/scala/resonantinduction/atomic/items/ItemCell.scala index d9740d78d..cf3efb6e5 100644 --- a/src/main/scala/resonantinduction/atomic/items/ItemCell.scala +++ b/src/main/scala/resonantinduction/atomic/items/ItemCell.scala @@ -17,7 +17,7 @@ class ItemCell extends ItemTooltip if (!name.equalsIgnoreCase("cellEmpty")) this.setContainerItem(AtomicContent.itemCell) this.setUnlocalizedName(Reference.prefix + name) this.setTextureName(Reference.prefix + name) - setCreativeTab(RICreativeTab.tab) + setCreativeTab(RICreativeTab) } override def getUnlocalizedName(itemstack: ItemStack): String = diff --git a/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.scala b/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.scala index 817362bcd..c11b0a2c3 100644 --- a/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.scala +++ b/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.scala @@ -45,7 +45,7 @@ class ItemFissileFuel extends ItemRadioactive with IReactorComponent this.setNoRepair this.setUnlocalizedName(Reference.prefix + "rodBreederFuel") this.setTextureName(Reference.prefix + "breederFuel") - setCreativeTab(RICreativeTab.tab) + setCreativeTab(RICreativeTab) def onReact(itemStack: ItemStack, reactor: IReactor) { diff --git a/src/main/scala/resonantinduction/atomic/items/ItemHazmat.scala b/src/main/scala/resonantinduction/atomic/items/ItemHazmat.scala index fb54441a8..e303c84a8 100644 --- a/src/main/scala/resonantinduction/atomic/items/ItemHazmat.scala +++ b/src/main/scala/resonantinduction/atomic/items/ItemHazmat.scala @@ -24,7 +24,7 @@ class ItemHazmat(slot: Int) extends ItemArmor(ItemHazmat.hazmatArmorMaterial, Re { this(slot) this.setUnlocalizedName(Reference.prefix + name) - this.setCreativeTab(RICreativeTab.tab) + this.setCreativeTab(RICreativeTab) this.setMaxDamage(200000) } diff --git a/src/main/scala/resonantinduction/core/RICreativeTab.scala b/src/main/scala/resonantinduction/core/RICreativeTab.scala index 19285cb27..3c257fad6 100644 --- a/src/main/scala/resonantinduction/core/RICreativeTab.scala +++ b/src/main/scala/resonantinduction/core/RICreativeTab.scala @@ -15,16 +15,5 @@ object RICreativeTab extends CreativeTabs(CreativeTabs.getNextID, "resonantinduc { var itemStack: ItemStack = null - override def getTabIconItem: Item = - { - if (itemStack != null) - return itemStack.getItem - else - return Items.iron_ingot - } - - def itemStack(item: ItemStack) - { itemStack = item } - - def tab = this + override def getTabIconItem: Item =itemStack.getItem } \ No newline at end of file diff --git a/src/main/scala/resonantinduction/core/ResonantInduction.scala b/src/main/scala/resonantinduction/core/ResonantInduction.scala index 39a1be4df..1b2ed5bbd 100644 --- a/src/main/scala/resonantinduction/core/ResonantInduction.scala +++ b/src/main/scala/resonantinduction/core/ResonantInduction.scala @@ -57,8 +57,6 @@ final object ResonantInduction loadables.applyModule(AtomicContent) loadables.preInit() - - RICreativeTab.itemStack = new ItemStack(CoreContent.decoration) } @EventHandler diff --git a/src/main/scala/resonantinduction/mechanical/MechanicalContent.scala b/src/main/scala/resonantinduction/mechanical/MechanicalContent.scala index 432e4b2c4..dde374ff8 100644 --- a/src/main/scala/resonantinduction/mechanical/MechanicalContent.scala +++ b/src/main/scala/resonantinduction/mechanical/MechanicalContent.scala @@ -58,8 +58,6 @@ object MechanicalContent extends ContentHolder NodeRegistry.register(classOf[TNodeMechanical], classOf[NodeMechanical]) - RICreativeTab.itemStack(new ItemStack(MechanicalContent.blockGrinderWheel)) - PacketAnnotationManager.INSTANCE.register(classOf[TileWindTurbine]) PacketAnnotationManager.INSTANCE.register(classOf[TileWaterTurbine])