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
package com.yourtinyhero.notenoughthings.blocks;

import java.util.Random;

import com.yourtinyhero.notenoughthings.NotEnoughThings;
import com.yourtinyhero.notenoughthings.Reference;

import net.minecraft.block.Block;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class BlockSoulGlass extends BlockBreakable {

	public BlockSoulGlass() {
		super(Material.GLASS, translucent);
		this.setLightOpacity(5);
		this.setUnlocalizedName(Reference.NotEnoughThingsBlocks.SOULGLASSBLOCK.getUnlocalizedName());
		this.setRegistryName(Reference.NotEnoughThingsBlocks.SOULGLASSBLOCK.getRegistryName());
		this.setCreativeTab(NotEnoughThings.tabNotEnoughThings);
	}
    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.TRANSLUCENT;
    }
    public boolean isOpaqueCube()
    {
        return false;
    }
    /**
     * Returns the quantity of items to drop on block destruction.
     */
    public int quantityDropped(Random random)
    {
        return 0;
    }

    protected boolean canSilkHarvest()
    {
        return true;
    }

    public boolean isFullCube()
    {
        return false;
    }
    public int getRenderBlockPass()
    {
        return 1;
    }
}

My code above

Edited by KalebCraft // TheCubeCub
Better layout

Which Minecraft version are you using?

 

I'm guessing you're using a version where Block#isOpaqueCube has an IBlockState parameter, which your isOpaqueCube method doesn't.

 

Always annotate override methods with @Override so you get a compilation error when they don't actually override a super method. You should also use your IDE to auto-generate override methods with the correct signature and annotation.

 

In future, please post code using a code block (the <> icon) or on Gist/Pastebin.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

10 minutes ago, KalebCraft // TheCubeCub said:

What is an IBlockState parameter?

 

Do you know what a parameter is? This is a basic Java concept.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

13 minutes ago, KalebCraft // TheCubeCub said:

Not really... I'm kinda new to modding, I've done some basic 1.7.10 modding ages ago, but yeah. Pretty new.

 

You need to have a solid understanding of Java before making a mod. As it says in this section's description, we're not here to help with basic Java problems.

 

Java has a tutorial on parameters here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.