Jump to content

Recommended Posts

Posted (edited)

[ANSWERED]

How do I make my Blocks have an Opacity like Glass

I tried going to another question but I couldn't find my answer

 

I tried using isOpaqueCube from Block.java

but It throughs an error because it is final

@Override
public final boolean isOpaqueCube(BlockState state, IBlockReader worldIn, BlockPos pos) {
    return false;
}

 

I do not know how to do this can someone please help.

 

here is my code:

Spoiler

import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class Plexiglass extends Block { public Plexiglass() { super(Properties.create(Material.GLASS) .sound(SoundType.METAL) .hardnessAndResistance(5.0f) .lightValue(14) .harvestTool(ToolType.PICKAXE) .variableOpacity() ); setRegistryName("plexiglass"); } }

 

Edited by MrNoodles75
Posted

For a similar effect in my mod (translucent crystal), I override isOpaqueCube and getBlockLayer in my block class.

 

	@Override
	public boolean isOpaqueCube(IBlockState state)
	{
		return false;
	}
	
	@SideOnly(Side.CLIENT)
	public BlockRenderLayer getBlockLayer()
	{
		return BlockRenderLayer.TRANSLUCENT;
	}

 

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Posted

@SerpentDagger

 
 
0
 Advanced issues found
 
 
4 minutes ago, SerpentDagger said:

For a similar effect in my mod (translucent crystal), I override isOpaqueCube and getBlockLayer in my block class.

 


	@Override
	public boolean isOpaqueCube(IBlockState state)
	{
		return false;
	}
	
	@SideOnly(Side.CLIENT)
	public BlockRenderLayer getBlockLayer()
	{
		return BlockRenderLayer.TRANSLUCENT;
	}

 

I'm pretty sure this is for 1.12 correct?

Posted
2 minutes ago, MrNoodles75 said:

 

I'm pretty sure this is for 1.12 correct?

That's correct, I'm using 1.12.2. I didn't think those methods would have changed between versions, but it's possible that they did. If so, I'm sorry about the confusion.

You may still need to override the two of them, but if it's significantly different in 1.14, then you should take my advice with a grain of salt.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Posted
38 minutes ago, SerpentDagger said:

public BlockRenderLayer getBlockLayer()

33 minutes ago, MrNoodles75 said:

I'm pretty sure this is for 1.12 correct?

It's called getRenderLayer now, and it is the only thing you have to override.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • 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  
  • Topics

×
×
  • Create New...

Important Information

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