Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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;

}

}

 

If that's your entire code, you seem to be missing a lot of things required to code a forge mod.

 

It looks like you aren't even using Forge. Are you wanting to use Forge?

Use the getTextureFromSideAndMetadata

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.