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

For some reason, my damaged block has same icons in inventory. Here's the code:

public class BlockPointer extends BlockContainer{
@SideOnly(Side.CLIENT)
private IIcon[] ico;

public BlockPointer(Material material){
	super(material);
	setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
	setBlockName("row.blockPointer");
	setCreativeTab(RoW.tabRoWEquip);
}

@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){
	list.add(new ItemStack(item, 1, 0));
	list.add(new ItemStack(item, 1, 1));
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p1, int p2){
	return this.ico[p2 % 2];
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_){
	this.ico = new IIcon[2];
	this.ico[0] = p_149651_1_.registerIcon("row:pointer");
	this.ico[1] = p_149651_1_.registerIcon("row:pointer_mod");
}

@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4){
	Block block = par1World.getBlock(par2, par3, par4);
	return (block == null || block.isReplaceable(par1World, par2, par3, par4)) && par1World.isSideSolid(par2, par3 - 1, par4, ForgeDirection.UP);
}

@Override
public void breakBlock(World world, int i, int j, int k, Block p_149749_5_, int p_149749_6_){
	world.removeTileEntity(i, j, k);
}

@Override
public boolean renderAsNormalBlock(){
	return false;
}

@Override
public int getRenderType(){
	return -1;
}

@Override
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l){
	return false;
}

@Override
public boolean isOpaqueCube(){
	return false;
}

@Override
public TileEntity createNewTileEntity(World world, int par2){
	return new TileEntityPointer();
}
}

However, those items have different metadata and set it to blocks correctly.

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

  • Author

I guess ItemBlockWithMetadata will work better. Ugh. Wanted to get it without additional items...

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

Guest
This topic is now closed to further replies.

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.