Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Java out of memory crash


Viper283
 Share

Recommended Posts

i have had the same problem before, the only crash report is that java has ran out of heap space

it only crashes when trying to load a world, and it only crashes with this block

if i remove the getTextureFromSide(int side) method it works, should i used getBlockTextureFromSideAndMetadata(int side, int meta)

 

the code i have used is as follows

 

/*******************************************************************************
* Copyright (c) 2012 Alchemist'.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Viper283
* Jamesc554544
* Alchemist
******************************************************************************/
package fma;

import net.minecraft.src.Block;
import net.minecraft.src.Material;

/**
* @author viper283
*
*/
public class ModBlocks {

public static Block chalk;
public static Block meta;
public static Block crate;


public static void initBlock() {
	chalk = new BlockChalk(ModIds.chalk, 5).setBlockName("chalk");
	meta = new FMAMetaBlock(ModIds.meta, Material.rock);
                crate = new BlockCrate(ModIds.crate, 3).setBlockName("crate");
}

}

and for the block class

/*******************************************************************************
* Copyright (c) 2012 Alchemist'.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Viper283
* Jamesc554544
* Alchemist
******************************************************************************/
package fma;

import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Material;

/**
* @author viper283
*
*/
public class BlockCrate extends Block {

/**
 * @param par1
 * @param par2
 */
public BlockCrate(int par1, int par2) {
	super(par1, par2, Material.wood);
	this.setCreativeTab(CreativeTabs.tabDeco);
	// TODO Auto-generated constructor stub
}

@Override
public String getTextureFile() {

	return Resources.blockTextures;
}

@Override
public int getBlockTextureFromSide(int side) {

	if(side == 1 || side == 5) {
		return 4;
	}
	return 3;

}

}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.