Results 1 to 4 of 4
  1. #1
    robeth is offline Member
    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    0

    Exclamation Java Error. Please Help

    PHP Code:
    package net.minecraft.src;
    
    import java.util.Random;
    
    public class BlockNewore extends Block
    
    {
    	public BlockNewOre(int i, int j);
    	{
    		super(i, j, Material.rock);
    	}
    	
    public int idDropped(int i, Random random);
    	{
    		return mod_Ore.newore.BlockID;
    	}
    }
    Error
    31: unclosed string literal
    newore = new BlockNewOre(1000, ModLoader.addOverride("/terrain.png", "/Mod/Blocks/ore.png)).setHardness(1.5F).setResistance(2.0F).se tBlockName("newore");
    I don't Get What To Do. Please tell me.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    The error is where the compiler tells you it is, not in the code you posted. Count the double quotes (") in line 31 of whatever file has the line in the error message. Do you get an even or odd number?

    In future, whenever seeking help with an error, post the entire stack trace, from beginning to end.

    db

  3. #3
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Another problem you will run into is that your constructor does not have the same name as the class(capitalization is important)

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    Looks like /Mod/Blocks/ore.png has a quotation mark at the beginning, but not at the end. That's an unclosed string literal.

    Using a syntax highlighting editor will help you spot things like this.
    Get in the habit of using standard Java naming conventions!

Similar Threads

  1. Replies: 0
    Last Post: 01-21-2011, 01:43 PM
  2. Replies: 5
    Last Post: 08-13-2010, 11:04 AM
  3. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 10:31 AM
  4. Replies: 1
    Last Post: 12-05-2009, 08:28 AM
  5. Replies: 1
    Last Post: 10-26-2009, 05:38 PM

Tags for this Thread

Posting Permissions

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