From ffcf71939de98bc78d0535c19bd25d2b4ed42f14 Mon Sep 17 00:00:00 2001 From: Leon Date: Sun, 23 Oct 2016 15:17:24 -0400 Subject: [PATCH] more porting. Still haven't broken anything yet. --- .../machinemuse/general/NBTTagAccessor.java | 2 + .../client/render/item/ToolRenderer.java | 2 +- .../powersuits/common/MPSItems.java | 45 +++++++++++++++++++ .../powersuits/common/ModCompatibility.java | 24 +++++----- .../powersuits/entity/EntityLuxCapacitor.java | 4 +- .../net/machinemuse/utils/MuseItemUtils.java | 2 +- .../net/machinemuse/api/MuseItemTag.java | 36 +++++++++++++++ .../net/machinemuse/api/MuseItemTag.scala | 31 ------------- .../render/modelspec/DefaultModelSpec.scala | 1 + .../render/modelspec/ModelRegistry.scala | 1 + .../powersuits/common/CommonProxy.scala | 5 +-- .../powersuits/common/Config.scala | 14 +++--- .../powersuits/common/MPSCreativeTab.scala | 2 +- .../powersuits/common/MPSItems.scala | 29 ------------ 14 files changed, 111 insertions(+), 87 deletions(-) create mode 100644 src/main/java/net/machinemuse/powersuits/common/MPSItems.java create mode 100644 src/main/scala/net/machinemuse/api/MuseItemTag.java delete mode 100644 src/main/scala/net/machinemuse/api/MuseItemTag.scala delete mode 100644 src/main/scala/net/machinemuse/powersuits/common/MPSItems.scala diff --git a/src/main/java/net/machinemuse/general/NBTTagAccessor.java b/src/main/java/net/machinemuse/general/NBTTagAccessor.java index 00d771c..5b6bf38 100644 --- a/src/main/java/net/machinemuse/general/NBTTagAccessor.java +++ b/src/main/java/net/machinemuse/general/NBTTagAccessor.java @@ -7,6 +7,7 @@ import net.machinemuse.numina.general.MuseLogger; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; +import javax.annotation.Nullable; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; @@ -53,6 +54,7 @@ public class NBTTagAccessor extends NBTTagCompound { } } + @Nullable public static Map getMap(NBTTagCompound nbt) { try { return (Map) getTagAccessor().invoke(nbt, nbt); diff --git a/src/main/java/net/machinemuse/powersuits/client/render/item/ToolRenderer.java b/src/main/java/net/machinemuse/powersuits/client/render/item/ToolRenderer.java index 83b81b1..4793b23 100644 --- a/src/main/java/net/machinemuse/powersuits/client/render/item/ToolRenderer.java +++ b/src/main/java/net/machinemuse/powersuits/client/render/item/ToolRenderer.java @@ -71,7 +71,7 @@ public class ToolRenderer extends MuseRender implements IItemRenderer { break; case INVENTORY: RenderBlocks renderInventory = (RenderBlocks) data[0]; - MuseIconUtils.drawIconAt(0, 0, MPSItems.powerTool().getIconIndex(itemStack), colour); + MuseIconUtils.drawIconAt(0, 0, MPSItems.INSTANCE.powerTool.getIconIndex(itemStack), colour); break; case EQUIPPED: RenderBlocks renderEquipped = (RenderBlocks) data[0]; diff --git a/src/main/java/net/machinemuse/powersuits/common/MPSItems.java b/src/main/java/net/machinemuse/powersuits/common/MPSItems.java new file mode 100644 index 0000000..7b2ab4c --- /dev/null +++ b/src/main/java/net/machinemuse/powersuits/common/MPSItems.java @@ -0,0 +1,45 @@ +package net.machinemuse.powersuits.common; + +import cpw.mods.fml.common.registry.GameRegistry; +import net.machinemuse.powersuits.block.BlockLuxCapacitor; +import net.machinemuse.powersuits.block.BlockTinkerTable; +import net.machinemuse.powersuits.item.*; +/** + * Created by Claire Semple on 9/9/2014. + * + * Ported to Java by lehjr on 10/22/16. + */ + +public final class MPSItems { + public final ItemPowerArmorHelmet powerArmorHead; + public final ItemPowerArmorChestplate powerArmorTorso; + public final ItemPowerArmorLeggings powerArmorLegs; + public final ItemPowerArmorBoots powerArmorFeet; + public final ItemPowerFist powerTool; + public final BlockTinkerTable tinkerTable; + public final BlockLuxCapacitor luxCapacitor; + public final ItemComponent components; + + public static MPSItems INSTANCE = new MPSItems(); + + private MPSItems() { + this.powerArmorHead = new ItemPowerArmorHelmet(); + GameRegistry.registerItem(this.powerArmorHead, this.powerArmorHead.getUnlocalizedName()); + this.powerArmorTorso = new ItemPowerArmorChestplate(); + GameRegistry.registerItem(this.powerArmorTorso, this.powerArmorTorso.getUnlocalizedName()); + this.powerArmorLegs = new ItemPowerArmorLeggings(); + GameRegistry.registerItem(this.powerArmorLegs, this.powerArmorLegs.getUnlocalizedName()); + this.powerArmorFeet = new ItemPowerArmorBoots(); + GameRegistry.registerItem(this.powerArmorFeet, this.powerArmorFeet.getUnlocalizedName()); + this.powerTool = new ItemPowerFist(); + GameRegistry.registerItem(this.powerTool, this.powerTool.getUnlocalizedName()); + this.tinkerTable = new BlockTinkerTable(); + GameRegistry.registerBlock(this.tinkerTable, this.tinkerTable.getUnlocalizedName()); + this.luxCapacitor = new BlockLuxCapacitor(); + GameRegistry.registerBlock(this.luxCapacitor, this.luxCapacitor.getUnlocalizedName()); + this.components = new ItemComponent(); + this.components.setUnlocalizedName("powerArmorComponent"); + GameRegistry.registerItem(this.components, "powerArmorComponent"); + this.components.populate(); + } +} \ No newline at end of file diff --git a/src/main/java/net/machinemuse/powersuits/common/ModCompatibility.java b/src/main/java/net/machinemuse/powersuits/common/ModCompatibility.java index 5a0d8bc..319e6fd 100644 --- a/src/main/java/net/machinemuse/powersuits/common/ModCompatibility.java +++ b/src/main/java/net/machinemuse/powersuits/common/ModCompatibility.java @@ -111,37 +111,37 @@ public class ModCompatibility { // CoFH Lib - CoFHLib is included in CoFHCore if (isCOFHLibLoaded()|| isCOFHCoreLoaded()) { - ModuleManager.addModule(new OmniWrenchModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); + ModuleManager.addModule(new OmniWrenchModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); } // Thaumcraft if (isThaumCraftLoaded() && enableThaumGogglesModule()) { - ModuleManager.addModule(new ThaumGogglesModule(Collections.singletonList((IModularItem) MPSItems.powerArmorHead()))); + ModuleManager.addModule(new ThaumGogglesModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerArmorHead))); } //IPowerModule module = new MultimeterModule(Collections.singletonList((IModularItem) MPSItems.powerTool())); // Hazmat if (isIndustrialCraftLoaded()) { - ModuleManager.addModule(new HazmatModule(Arrays.asList(MPSItems.powerArmorHead(), MPSItems.powerArmorTorso(), MPSItems.powerArmorLegs(), MPSItems.powerArmorFeet()))); + ModuleManager.addModule(new HazmatModule(Arrays.asList(MPSItems.INSTANCE.powerArmorHead, MPSItems.INSTANCE.powerArmorTorso, MPSItems.INSTANCE.powerArmorLegs, MPSItems.INSTANCE.powerArmorFeet))); } // Galacticraft if (isGalacticraftLoaded()) { - ModuleManager.addModule(new AirtightSealModule(Collections.singletonList((IModularItem) MPSItems.powerArmorHead()))); + ModuleManager.addModule(new AirtightSealModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerArmorHead))); } // Forestry if (isForestryLoaded()) { - ModuleManager.addModule(new GrafterModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); - ModuleManager.addModule(new ScoopModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); - ModuleManager.addModule(new ApiaristArmorModule(Arrays.asList(MPSItems.powerArmorHead(), MPSItems.powerArmorTorso(), MPSItems.powerArmorLegs(), MPSItems.powerArmorFeet()))); + ModuleManager.addModule(new GrafterModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); + ModuleManager.addModule(new ScoopModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); + ModuleManager.addModule(new ApiaristArmorModule(Arrays.asList(MPSItems.INSTANCE.powerArmorHead, MPSItems.INSTANCE.powerArmorTorso, MPSItems.INSTANCE.powerArmorLegs, MPSItems.INSTANCE.powerArmorFeet))); } // Chisel if(isChiselLoaded()) { try { - ModuleManager.addModule(new ChiselModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); + ModuleManager.addModule(new ChiselModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); } catch(Exception e) { MuseLogger.logException("Couldn't add Chisel module", e); } @@ -149,21 +149,21 @@ public class ModCompatibility { // Applied Energistics if (isAppengLoaded()) { - ModuleManager.addModule(new AppEngWirelessModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); + ModuleManager.addModule(new AppEngWirelessModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); // Extra Cells 2 if (isExtraCellsLoaded()) - ModuleManager.addModule(new AppEngWirelessFluidModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); + ModuleManager.addModule(new AppEngWirelessFluidModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); } // Multi-Mod Compatible OmniProbe if (isEnderIOLoaded() || isMFRLoaded() || isRailcraftLoaded()) { - ModuleManager.addModule(new OmniProbeModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); + ModuleManager.addModule(new OmniProbeModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); } // Compact Machines Personal Shrinking Device if (isCompactMachinesLoaded()) { - ModuleManager.addModule(new PersonalShrinkingModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); + ModuleManager.addModule(new PersonalShrinkingModule(Collections.singletonList((IModularItem) MPSItems.INSTANCE.powerTool))); } } } \ No newline at end of file diff --git a/src/main/java/net/machinemuse/powersuits/entity/EntityLuxCapacitor.java b/src/main/java/net/machinemuse/powersuits/entity/EntityLuxCapacitor.java index ca8f325..000f896 100644 --- a/src/main/java/net/machinemuse/powersuits/entity/EntityLuxCapacitor.java +++ b/src/main/java/net/machinemuse/powersuits/entity/EntityLuxCapacitor.java @@ -75,7 +75,7 @@ public class EntityLuxCapacitor extends EntityThrowable { if (block == null || block.isAir(worldObj, x, y, z)) { Block blockToStickTo = worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); if (blockToStickTo.isNormalCube(worldObj, x, y, z)) { - worldObj.setBlock(x, y, z, MPSItems.luxCapacitor(), 0, 7); + worldObj.setBlock(x, y, z, MPSItems.INSTANCE.luxCapacitor, 0, 7); worldObj.setTileEntity(x, y, z, new TileEntityLuxCapacitor(dir, red, green, blue)); } else { for (ForgeDirection d : ForgeDirection.values()) { @@ -84,7 +84,7 @@ public class EntityLuxCapacitor extends EntityThrowable { int zo = z + d.offsetZ; blockToStickTo = worldObj.getBlock(xo, yo, zo); if (blockToStickTo.isNormalCube(worldObj, x, y, z)) { - worldObj.setBlock(x, y, z, MPSItems.luxCapacitor(), 0, 7); + worldObj.setBlock(x, y, z, MPSItems.INSTANCE.luxCapacitor, 0, 7); worldObj.setTileEntity(x, y, z, new TileEntityLuxCapacitor(d, red, green, blue)); } } diff --git a/src/main/java/net/machinemuse/utils/MuseItemUtils.java b/src/main/java/net/machinemuse/utils/MuseItemUtils.java index c1f7711..bbf3d56 100644 --- a/src/main/java/net/machinemuse/utils/MuseItemUtils.java +++ b/src/main/java/net/machinemuse/utils/MuseItemUtils.java @@ -552,7 +552,7 @@ public class MuseItemUtils { public static void setFluidTermTag(ItemStack stack, NBTTagCompound tag) { NBTTagCompound t = MuseItemUtils.getMuseItemTag(stack); t.setTag("AppEng EC Wireless Fluid Terminal", tag); - stack.stackTagCompound.setTag(MuseItemTag.NBTPREFIX(), t); + stack.stackTagCompound.setTag(MuseItemTag.NBTPREFIX, t); } public static boolean getCanShrink(ItemStack stack) { diff --git a/src/main/scala/net/machinemuse/api/MuseItemTag.java b/src/main/scala/net/machinemuse/api/MuseItemTag.java new file mode 100644 index 0000000..26272cb --- /dev/null +++ b/src/main/scala/net/machinemuse/api/MuseItemTag.java @@ -0,0 +1,36 @@ +package net.machinemuse.api; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import javax.annotation.Nullable; + +/** + * Author: MachineMuse (Claire Semple) + * Created: 6:58 PM, 8/6/13 + * + * Ported to Java by lehjr on 10/22/16. + */ +public class MuseItemTag { + public static final String NBTPREFIX = "mmmpsmod"; + + /** + * Gets or creates stack.getTagCompound().getTag(NBTPREFIX) + * + * @param stack + * @return an NBTTagCompound, may be newly created. If stack is null, + * returns null. + */ + @Nullable + public static NBTTagCompound getMuseItemTag(ItemStack stack) { + if (stack == null) { + return null; + } + + NBTTagCompound stackTag = (stack.hasTagCompound()) ? stack.getTagCompound() : new NBTTagCompound(); + stack.setTagCompound(stackTag); + NBTTagCompound properties = (stackTag.hasKey(NBTPREFIX)) ? stackTag.getCompoundTag(NBTPREFIX) : new NBTTagCompound(); + stackTag.setTag(NBTPREFIX, properties); + return properties; + } +} \ No newline at end of file diff --git a/src/main/scala/net/machinemuse/api/MuseItemTag.scala b/src/main/scala/net/machinemuse/api/MuseItemTag.scala deleted file mode 100644 index 053c3a3..0000000 --- a/src/main/scala/net/machinemuse/api/MuseItemTag.scala +++ /dev/null @@ -1,31 +0,0 @@ -package net.machinemuse.api - -import net.minecraft.item.ItemStack -import net.minecraft.nbt.NBTTagCompound - -/** - * Author: MachineMuse (Claire Semple) - * Created: 6:58 PM, 8/6/13 - */ -object MuseItemTag { - final val NBTPREFIX: String = "mmmpsmod" - - /** - * Gets or creates stack.getTagCompound().getTag(NBTPREFIX) - * - * @param stack - * @return an NBTTagCompound, may be newly created. If stack is null, - * returns null. - */ - def getMuseItemTag(stack: ItemStack): NBTTagCompound = { - if (stack == null) { - return null - } - val stackTag: NBTTagCompound = if (stack.hasTagCompound) stack.getTagCompound else new NBTTagCompound - stack.setTagCompound(stackTag) - val properties: NBTTagCompound = if (stackTag.hasKey(NBTPREFIX)) stackTag.getCompoundTag(NBTPREFIX) else new NBTTagCompound - stackTag.setTag(NBTPREFIX, properties) - - properties - } -} diff --git a/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/DefaultModelSpec.scala b/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/DefaultModelSpec.scala index 1302c0f..fb1ba28 100644 --- a/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/DefaultModelSpec.scala +++ b/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/DefaultModelSpec.scala @@ -51,6 +51,7 @@ object DefaultModelSpec { ModelRegistry.loadModel(file) match { case Some(m) => Some(ModelRegistry.put(MuseStringUtils.extractName(file), new ModelSpec(m, textures, None, None, file.toString))) case None => MuseLogger.logError("Model file " + file + " not found! D:") + None } } diff --git a/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/ModelRegistry.scala b/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/ModelRegistry.scala index a7c8114..2e4df40 100644 --- a/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/ModelRegistry.scala +++ b/src/main/scala/net/machinemuse/powersuits/client/render/modelspec/ModelRegistry.scala @@ -26,6 +26,7 @@ object ModelRegistry extends MuseRegistry[ModelSpec] { AdvancedModelLoader.loadModel(resource) match { case m: WavefrontObject => Some(m) case _ => MuseLogger.logError("Model loading failed :( " + resource) + None } } diff --git a/src/main/scala/net/machinemuse/powersuits/common/CommonProxy.scala b/src/main/scala/net/machinemuse/powersuits/common/CommonProxy.scala index 913a633..7f2b367 100644 --- a/src/main/scala/net/machinemuse/powersuits/common/CommonProxy.scala +++ b/src/main/scala/net/machinemuse/powersuits/common/CommonProxy.scala @@ -8,7 +8,6 @@ import net.machinemuse.general.sound.SoundDictionary import net.machinemuse.numina.network.{MusePacket, MusePacketHandler, MusePacketModeChangeRequest, PacketSender} import net.machinemuse.numina.render.RenderGameOverlayEventHandler import net.machinemuse.powersuits.block.{BlockTinkerTable, TileEntityLuxCapacitor, TileEntityTinkerTable} -import net.machinemuse.powersuits.client.render.TinkerTableRenderer import net.machinemuse.powersuits.client.render.block.{RenderLuxCapacitorTESR, TinkerTableRenderer} import net.machinemuse.powersuits.client.render.entity.{RenderLuxCapacitorEntity, RenderPlasmaBolt, RenderSpinningBlade} import net.machinemuse.powersuits.client.render.item.ToolRenderer @@ -50,7 +49,7 @@ class ClientProxy extends CommonProxy { * Register all the custom renderers for this mod. */ override def registerRenderers { - MinecraftForgeClient.registerItemRenderer(MPSItems.powerTool, new ToolRenderer) + MinecraftForgeClient.registerItemRenderer(MPSItems.INSTANCE.powerTool, new ToolRenderer) val tinkTableRenderID: Int = RenderingRegistry.getNextAvailableRenderId val tinkTableRenderer: TinkerTableRenderer = new TinkerTableRenderer(tinkTableRenderID) BlockTinkerTable.setRenderType(tinkTableRenderID) @@ -58,7 +57,7 @@ class ClientProxy extends CommonProxy { RenderingRegistry.registerBlockHandler(tinkTableRenderer) val luxCapacitorRenderID: Int = RenderingRegistry.getNextAvailableRenderId val luxCapacitorRenderer: RenderLuxCapacitorTESR = new RenderLuxCapacitorTESR(luxCapacitorRenderID) - MPSItems.luxCapacitor.setRenderType(luxCapacitorRenderID) + MPSItems.INSTANCE.luxCapacitor.setRenderType(luxCapacitorRenderID) ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileEntityLuxCapacitor], luxCapacitorRenderer) RenderingRegistry.registerBlockHandler(luxCapacitorRenderer) RenderingRegistry.registerEntityRenderingHandler(classOf[EntityPlasmaBolt], new RenderPlasmaBolt) diff --git a/src/main/scala/net/machinemuse/powersuits/common/Config.scala b/src/main/scala/net/machinemuse/powersuits/common/Config.scala index e51ee2d..35b60a4 100644 --- a/src/main/scala/net/machinemuse/powersuits/common/Config.scala +++ b/src/main/scala/net/machinemuse/powersuits/common/Config.scala @@ -176,13 +176,13 @@ object Config { * they are hardcoded. */ def loadPowerModules() { - val ARMORONLY: List[IModularItem] = Arrays.asList[IModularItem](MPSItems.powerArmorHead.asInstanceOf[IModularItem], MPSItems.powerArmorTorso.asInstanceOf[IModularItem], MPSItems.powerArmorLegs.asInstanceOf[IModularItem], MPSItems.powerArmorFeet.asInstanceOf[IModularItem]) - val ALLITEMS: List[IModularItem] = Arrays.asList(MPSItems.powerArmorHead.asInstanceOf[IModularItem], MPSItems.powerArmorTorso.asInstanceOf[IModularItem], MPSItems.powerArmorLegs.asInstanceOf[IModularItem], MPSItems.powerArmorFeet.asInstanceOf[IModularItem], MPSItems.powerTool.asInstanceOf[IModularItem]) - val HEADONLY: List[IModularItem] = Collections.singletonList(MPSItems.powerArmorHead.asInstanceOf[IModularItem]) - val TORSOONLY: List[IModularItem] = Collections.singletonList(MPSItems.powerArmorTorso.asInstanceOf[IModularItem]) - val LEGSONLY: List[IModularItem] = Collections.singletonList(MPSItems.powerArmorLegs.asInstanceOf[IModularItem]) - val FEETONLY: List[IModularItem] = Collections.singletonList(MPSItems.powerArmorFeet.asInstanceOf[IModularItem]) - val TOOLONLY: List[IModularItem] = Collections.singletonList(MPSItems.powerTool.asInstanceOf[IModularItem]) + val ARMORONLY: List[IModularItem] = Arrays.asList[IModularItem](MPSItems.INSTANCE.powerArmorHead.asInstanceOf[IModularItem], MPSItems.INSTANCE.powerArmorTorso.asInstanceOf[IModularItem], MPSItems.INSTANCE.powerArmorLegs.asInstanceOf[IModularItem], MPSItems.INSTANCE.powerArmorFeet.asInstanceOf[IModularItem]) + val ALLITEMS: List[IModularItem] = Arrays.asList(MPSItems.INSTANCE.powerArmorHead.asInstanceOf[IModularItem], MPSItems.INSTANCE.powerArmorTorso.asInstanceOf[IModularItem], MPSItems.INSTANCE.powerArmorLegs.asInstanceOf[IModularItem], MPSItems.INSTANCE.powerArmorFeet.asInstanceOf[IModularItem], MPSItems.INSTANCE.powerTool.asInstanceOf[IModularItem]) + val HEADONLY: List[IModularItem] = Collections.singletonList(MPSItems.INSTANCE.powerArmorHead.asInstanceOf[IModularItem]) + val TORSOONLY: List[IModularItem] = Collections.singletonList(MPSItems.INSTANCE.powerArmorTorso.asInstanceOf[IModularItem]) + val LEGSONLY: List[IModularItem] = Collections.singletonList(MPSItems.INSTANCE.powerArmorLegs.asInstanceOf[IModularItem]) + val FEETONLY: List[IModularItem] = Collections.singletonList(MPSItems.INSTANCE.powerArmorFeet.asInstanceOf[IModularItem]) + val TOOLONLY: List[IModularItem] = Collections.singletonList(MPSItems.INSTANCE.powerTool.asInstanceOf[IModularItem]) addModule(new BasicPlatingModule(ARMORONLY)) addModule(new DiamondPlatingModule(ARMORONLY)) addModule(new EnergyShieldModule(ARMORONLY)) diff --git a/src/main/scala/net/machinemuse/powersuits/common/MPSCreativeTab.scala b/src/main/scala/net/machinemuse/powersuits/common/MPSCreativeTab.scala index c044b62..3f3dfe4 100644 --- a/src/main/scala/net/machinemuse/powersuits/common/MPSCreativeTab.scala +++ b/src/main/scala/net/machinemuse/powersuits/common/MPSCreativeTab.scala @@ -3,5 +3,5 @@ package net.machinemuse.powersuits.common import net.minecraft.creativetab.CreativeTabs object MPSCreativeTab extends CreativeTabs(CreativeTabs.getNextID, "powersuits") { - def getTabIconItem = MPSItems.powerArmorHead + def getTabIconItem = MPSItems.INSTANCE.powerArmorHead } \ No newline at end of file diff --git a/src/main/scala/net/machinemuse/powersuits/common/MPSItems.scala b/src/main/scala/net/machinemuse/powersuits/common/MPSItems.scala deleted file mode 100644 index 23b1f46..0000000 --- a/src/main/scala/net/machinemuse/powersuits/common/MPSItems.scala +++ /dev/null @@ -1,29 +0,0 @@ -package net.machinemuse.powersuits.common - -import cpw.mods.fml.common.registry.GameRegistry -import net.machinemuse.powersuits.block.{BlockLuxCapacitor, BlockTinkerTable} -import net.machinemuse.powersuits.item._ - -/** - * Created by Claire Semple on 9/9/2014. - */ -object MPSItems { - val powerArmorHead = new ItemPowerArmorHelmet - GameRegistry.registerItem(powerArmorHead, powerArmorHead.getUnlocalizedName) - val powerArmorTorso = new ItemPowerArmorChestplate - GameRegistry.registerItem(powerArmorTorso, powerArmorTorso.getUnlocalizedName) - val powerArmorLegs = new ItemPowerArmorLeggings - GameRegistry.registerItem(powerArmorLegs, powerArmorLegs.getUnlocalizedName) - val powerArmorFeet = new ItemPowerArmorBoots - GameRegistry.registerItem(powerArmorFeet, powerArmorFeet.getUnlocalizedName) - val powerTool = new ItemPowerFist - GameRegistry.registerItem(powerTool, powerTool.getUnlocalizedName) - val tinkerTable = new BlockTinkerTable - GameRegistry.registerBlock(tinkerTable, tinkerTable.getUnlocalizedName) - val luxCapacitor = new BlockLuxCapacitor - GameRegistry.registerBlock(luxCapacitor, luxCapacitor.getUnlocalizedName) - val components = new ItemComponent() - components.setUnlocalizedName("powerArmorComponent") - GameRegistry.registerItem(components, "powerArmorComponent") - components.populate() -}