Results 1 to 6 of 6
  1. #1
    hosker666 is offline Member
    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0

    Default Is Not Abstract Error

    Hi, I am new to Java.

    I have looked on this forum and seen other people with this error and the solution seems to be to add the method.

    however, i am certain i already have can someone tell me what is going wrong here??

    ERROR:
    Java Code:
    src\minecraft\net\minecraft\src\mod_plasmariteGem.java:113: error: mod_plasmariteGem is not abstract and does not override abstract method getTransferLimit() in IElectricItem public class mod_plasmariteGem extends BaseMod
                                                      ^
    My source code for my java file is:
    Java Code:
    package net.minecraft.src;
     
    import cpw.*;
    import cpw.mods.*;
    import cpw.mods.fml.*;
    import cpw.mods.fml.client.*;
    import cpw.mods.fml.client.modloader.*;
    import cpw.mods.fml.client.registry.*;
    import cpw.mods.fml.common.*;
    import cpw.mods.fml.common.asm.*;
    import cpw.mods.fml.common.asm.transformers.*;
    import cpw.mods.fml.common.discovery.*;
    import cpw.mods.fml.common.discovery.asm.*;
    import cpw.mods.fml.common.event.*;
    import cpw.mods.fml.common.functions.*;
    import cpw.mods.fml.common.modloader.*;
    import cpw.mods.fml.common.network.*;
    import cpw.mods.fml.common.registry.*;
    import cpw.mods.fml.common.toposort.*;
    import cpw.mods.fml.common.versioning.*;
    import cpw.mods.fml.relauncher.*;
    import cpw.mods.fml.server.*;
    import ibxm.*;
    import net.*;
    import net.minecraft.*;
    import net.minecraft.block.*;
    import net.minecraft.block.material.*;
    import net.minecraft.client.*;
    import net.minecraft.client.audio.*;
    import net.minecraft.client.entity.*;
    import net.minecraft.client.gui.*;
    import net.minecraft.client.gui.achievement.*;
    import net.minecraft.client.gui.inventory.*;
    import net.minecraft.client.model.*;
    import net.minecraft.client.multiplayer.*;
    import net.minecraft.client.particle.*;
    import net.minecraft.client.renderer.*;
    import net.minecraft.client.renderer.culling.*;
    import net.minecraft.client.renderer.entity.*;
    import net.minecraft.client.renderer.texturefx.*;
    import net.minecraft.client.renderer.tileentity.*;
    import net.minecraft.client.settings.*;
    import net.minecraft.client.texturepacks.*;
    import net.minecraft.command.*;
    import net.minecraft.crash.*;
    import net.minecraft.creativetab.*;
    import net.minecraft.dispenser.*;
    import net.minecraft.enchantment.*;
    import net.minecraft.entity.*;
    import net.minecraft.entity.ai.*;
    import net.minecraft.entity.boss.*;
    import net.minecraft.entity.effect.*;
    import net.minecraft.entity.item.*;
    import net.minecraft.entity.monster.*;
    import net.minecraft.entity.passive.*;
    import net.minecraft.entity.player.*;
    import net.minecraft.entity.projectile.*;
    import net.minecraft.inventory.*;
    import net.minecraft.item.*;
    import net.minecraft.item.crafting.*;
    import net.minecraft.nbt.*;
    import net.minecraft.network.*;
    import net.minecraft.network.packet.*;
    import net.minecraft.network.rcon.*;
    import net.minecraft.pathfinding.*;
    import net.minecraft.potion.*;
    import net.minecraft.profiler.*;
    import net.minecraft.server.*;
    import net.minecraft.server.dedicated.*;
    import net.minecraft.server.gui.*;
    import net.minecraft.server.integrated.*;
    import net.minecraft.server.management.*;
    import net.minecraft.src.*;
    import net.minecraft.stats.*;
    import net.minecraft.tileentity.*;
    import net.minecraft.util.*;
    import net.minecraft.village.*;
    import net.minecraft.world.*;
    import net.minecraft.world.biome.*;
    import net.minecraft.world.chunk.*;
    import net.minecraft.world.chunk.storage.*;
    import net.minecraft.world.demo.*;
    import net.minecraft.world.gen.*;
    import net.minecraft.world.gen.feature.*;
    import net.minecraft.world.gen.layer.*;
    import net.minecraft.world.gen.structure.*;
    import net.minecraft.world.storage.*;
    import net.minecraftforge.*;
    import net.minecraftforge.classloading.*;
    import net.minecraftforge.client.*;
    import net.minecraftforge.client.event.*;
    import net.minecraftforge.client.event.sound.*;
    import net.minecraftforge.common.*;
    import net.minecraftforge.event.*;
    import net.minecraftforge.event.entity.*;
    import net.minecraftforge.event.entity.item.*;
    import net.minecraftforge.event.entity.living.*;
    import net.minecraftforge.event.entity.minecart.*;
    import net.minecraftforge.event.entity.player.*;
    import net.minecraftforge.event.terraingen.*;
    import net.minecraftforge.event.world.*;
    import net.minecraftforge.liquids.*;
    import net.minecraftforge.oredict.*;
    import net.minecraftforge.transformers.*;
    import paulscode.*;
    import paulscode.sound.*;
    import paulscode.sound.codecs.*;
    import ic2.*;
    import ic2.api.IElectricItem;
     
    import java.util.Random;
    
    public class mod_plasmariteGem extends BaseMod
    implements IElectricItem{
     
    public mod_plasmariteGem(){}
     
    public static Item block;public void load(){
     
    ModLoader.addSmelting(mod_plasmariteOre.block.blockID, new ItemStack(block), 1.0f);
    ModLoader.addName(block, "Plasmarite Gem");}
    public String getVersion(){
    return "1.0";
    }
     
    static{
    block = (new ItemplasmariteGem(148)).setIconCoord(0, 1).setItemName("Plasmarite Gem");
     
    }
     
    static class ItemplasmariteGem extends Item{
     
    public ItemplasmariteGem(int par1){
    super(par1);
    setMaxDamage(0);
    maxStackSize = 8;
    setCreativeTab(CreativeTabs.tabMaterials);
    }
    public String getTextureFile(){return "/plasmarite.png";}
    public int getItemEnchantability()
    {
        return 0;
    }
    public int getMaxItemUseDuration(ItemStack par1ItemStack)
    {
        return 0;
    }
    public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
    {
        return 1.0F;
    }
    public int getDamageVsEntity(Entity par1Entity)
    {
        return 0;
    }
    public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack)
    {
        return true;
    }
    public interface IElectricItem
    {
    	
    }
    
    
    	public boolean canProvideEnergy()
      {
        return true;
      }
      public int getMaxCharge()
      {
        return 1000000000;
      }
     
      public int getTier()
      {
        return 3;
      }
     
      public int getTransferLimit()
      {
    	  return 500;
      }
     
    
     
     
    }}
    I am using Eclipse as my IDE and using the following commands to compile:
    Java Code:
    @echo off
    runtime\bin\python\python_mcp runtime\recompile.py %*
    pause
    Found in a batch file as part of MCP (Minecraft Coder's Pack)

    any help would be amazing! thank you!

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    758
    Rep Power
    8

    Default Re: Is Not Abstract Error

    Hello,

    The error because your class mod_plasmariteGem does not have the implementation required by the IElectricItem interface. You have the methods from this interface in your code but you place them inside the ItemplasmariteGem class.

  3. #3
    hosker666 is offline Member
    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0

    Default Re: Is Not Abstract Error

    Quote Originally Posted by wsaryada View Post
    Hello,

    The error because your class mod_plasmariteGem does not have the implementation required by the IElectricItem interface. You have the methods from this interface in your code but you place them inside the ItemplasmariteGem class.
    Ah thank you I will change that and get to back to the forum if it works

  4. #4
    hosker666 is offline Member
    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0

    Default Re: Is Not Abstract Error

    Quote Originally Posted by wsaryada View Post
    Hello,

    The error because your class mod_plasmariteGem does not have the implementation required by the IElectricItem interface. You have the methods from this interface in your code but you place them inside the ItemplasmariteGem class.
    Hi, yeah I am really struggling to work out where i need to put the method now. This is my first piece of java and i am self-taught so please forgive me if i am being really dumb! Can somebody please suggest to me how i should arrange this code so that it will work??

    thanks

  5. #5
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    758
    Rep Power
    8

    Default Re: Is Not Abstract Error

    Your code is like this:

    Java Code:
    public class mod_plasmariteGem extends BaseMod implements IElectricItem {
    
        static class ItemplasmariteGem extends Item {
            public boolean canProvideEnergy() {
                return true;
            }
    
            public int getMaxCharge() {
                return 1000000000;
            }
    
            public int getTier() {
                return 3;
            }
    
            public int getTransferLimit() {
                return 500;
            }
        }
    }
    These methods inside the ItemplasmariteGem class above should not be there, because these method are methods defined in the IElectricItem interface. It should be in the scope of mod_plasmariteGem and not in ItemplasmariteGem.

  6. #6
    hosker666 is offline Member
    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0

    Default Re: Is Not Abstract Error

    Hey thanks, yeah i was implementing to the class when i should have been implementing to the object. Fixed it by moving the implementation to
    Java Code:
    static class ItemplasmariteGem extends Item implements IElectricItem{

Similar Threads

  1. Replies: 3
    Last Post: 06-19-2012, 11:59 PM
  2. Replies: 2
    Last Post: 09-27-2011, 03:59 PM
  3. abstract error using implements
    By bptsj in forum New To Java
    Replies: 2
    Last Post: 09-04-2011, 05:33 AM
  4. Replies: 4
    Last Post: 02-19-2011, 04:32 AM
  5. Replies: 6
    Last Post: 10-27-2008, 12:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •