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'm making a type of glass for my mod, and I've coded the json files properly, and the texture I'm using is transparent. The glass renders as transparent in my hand and in my inventory, but when I place it down there's a weird black texture in the areas where it should be transparent. Does anyone know what could be wrong?

 

This is my code for the glass block's class.

package xstuffmods.rfnp.blocks;

import xstuffmods.rfnp.RFnP;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class GreenhouseGlass extends BlockBreakable{

public GreenhouseGlass(Material materialIn, boolean ignoreSimilarityIn) {
	super(materialIn.glass, ignoreSimilarityIn);
	GameRegistry.registerBlock(this, "greenhouseGlass");
	setUnlocalizedName("greenhouseGlass");
	setStepSound(soundTypeGlass);
	setHardness(1.0F);
	setResistance(0.0F);
	setCreativeTab(RFnP.cTab);
	// TODO Auto-generated constructor stub
}

}

try adding this to your glass class:

@Override

public EnumWorldBlockLayer getBlockLayer() {

 

return EnumWorldBlockLayer.CUTOUT;

}

 

 

example:

 

package xstuffmods.rfnp.blocks;

 

import xstuffmods.rfnp.RFnP;

import net.minecraft.block.BlockBreakable;

import net.minecraft.block.material.Material;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

public class GreenhouseGlass extends BlockBreakable{

 

public GreenhouseGlass(Material materialIn, boolean ignoreSimilarityIn) {

super(materialIn.glass, ignoreSimilarityIn);

GameRegistry.registerBlock(this, "greenhouseGlass");

setUnlocalizedName("greenhouseGlass");

setStepSound(soundTypeGlass);

setHardness(1.0F);

setResistance(0.0F);

setCreativeTab(RFnP.cTab);

// TODO Auto-generated constructor stub

}

 

        @Override

public EnumWorldBlockLayer getBlockLayer() {

 

return EnumWorldBlockLayer.CUTOUT;

}

}

 

 

 

I believe this should fix your problem

I had the same problem with glass, but when i used that code I could use the glass like an x-ray: the bottom and top of the block allowed me to see through the world...

To allow transparency in models you need to override two Block methods with the methods below:

 

@Override

public boolean isOpaqueCube() {

return false;

}

 

@Override

public EnumWorldBlockLayer getBlockLayer() {

return EnumWorldBlockLayer.CUTOUT;

}

 

The method isOpaqueCube is set to false already by you extending BlockBreakable instead of Block. This third method below might help some shading bugs. Hope it works out.

 

@Override

public boolean isFullCube() {

        return false;

}

 

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.