Jump to content

Recommended Posts

Posted

So first time using forge and the thing is my glass is working BUT in my hand it's not showing as it's texture. It's showing as a full black block. I don't know why. Here are some pics

 

http://gyazo.com/9ae6aac77fd9a4bdaa9f6c9623de98b2

 

here is my code:

 

public class BlockBallisticsGlass extends Block {

public BlockBallisticsGlass() {
	super(Material.glass);
	setBlockName("glass_ballistics");
	setBlockTextureName(DarkPack.MODID + ":" + getUnlocalizedName().substring(5));
	setCreativeTab(CreativeTabs.tabBlock);
	setStepSound(soundTypeGlass);
	setHardness(1.0F);
	setResistance(1000F);
}

public int getBlockTextureFromSideAndMetadata(int i, int j) {
	return 9;
}

public int quantityDropped(Random r) {  
	return 0;
}

@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
	return 1;
}

public boolean isOpaqueCube() {
	return false;
}

public boolean renderAsNormalBlock() {
	return false;
}

protected boolean canSilkHarvest() {
	return true;
}

}

Posted

Hi

 

From memory, items in your hand are rendered with alpha blending turned off.  So the partially-transparent parts of your block are rendered as totally opaque.

 

You could get around this by implementing an ISimpleBlockRenderingHandler and drawing your icon with alpha blending enabled

eg

 

http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html

 

and

    try {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);

        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

     // do your rendering here
    } finally {
      GL11.glPopAttrib();
    }

 

-TGG

Posted

Hi

 

From memory, items in your hand are rendered with alpha blending turned off.  So the partially-transparent parts of your block are rendered as totally opaque.

 

You could get around this by implementing an ISimpleBlockRenderingHandler and drawing your icon with alpha blending enabled

eg

 

http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html

 

and

    try {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);

        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

     // do your rendering here
    } finally {
      GL11.glPopAttrib();
    }

 

-TGG

 

This was the case pre-1.7. Look here: http://puu.sh/8Sq6V.png

Either there's something missing or the vanilla renderer has exceptions for specific blocks (like the stained glass)

 

EDIT: looking at it again, if the renderBlockPass is > 0, it uses blend (look at the doRender method, line 124 in class RenderItem)

 

 

BTW: Always add @Override to methods you intend to override! It shows you errors if you, for example, made a typo somewhere or the method signature changed.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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...

×   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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
    • Maybe you need to create file in assets/<modid>/items/<itemname>.json with content like this:   { "model": { "type": "minecraft:model", "model": "modname:item/itemname" } }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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