Jump to content

[1.15.2] Block Transparency Not Working


ModMCdl

Recommended Posts

Hello, I am creating a custom type of lantern in the game, and to do this I'm pulling directly from the LanternBlock class:

public static final RegistryObject<Block> VOID_LANTERN = BLOCKS.register("void_lantern", () -> new LanternBlock(Block.Properties.from(Blocks.LANTERN)));

In-game the lantern has the correct model, and the textures are mapped correctly, however there is no transparency within the textures themselves. You can see what I mean in the pic below. How would I go about fixing this. 1.12.2 was the last time I dealt with modding, and it seems the entire games rendering system has changed since then.

 

image.thumb.png.58257a04cee5663ce51a5a50f2ffe639.png

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

2 minutes ago, imacatlolol said:

You need to call RenderTypeLookup.setRenderLayer in the client setup event to define the block's render type. I recommend using CUTOUT, but CUTOUT_MIPPED would also work.

How am I calling this? Can you point me in a direction for an example of this in action? 

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

4 minutes ago, ModMCdl said:

How am I calling this? Can you point me in a direction for an example of this in action? 

It's a static method. You just call it directly in the client setup event (FMLClientSetupEvent). It wants a Block and a RenderType, so simply provide it with what I said. I'm not sure what the confusing part is, this should be basic Java. If you don't know how to subscribe to events, read the docs.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Link to comment
Share on other sites

11 minutes ago, imacatlolol said:

It's a static method. You just call it directly in the client setup event (FMLClientSetupEvent). It wants a Block and a RenderType, so simply provide it with what I said. I'm not sure what the confusing part is, this should be basic Java. If you don't know how to subscribe to events, read the docs.

Got it, I didn't know it was a static method, and IntelliJ didn't want to autocomplete it as one. Your second explanation was also much more clear than the first. As I said before, the last time I dealt with transparency, it was overridden directly in a custom block class. Thanks!

Edited by ModMCdl

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

57 minutes ago, ModMCdl said:

Got it, I didn't know it was a static method, and IntelliJ didn't want to autocomplete it as one. Your second explanation was also much more clear than the first. As I said before, the last time I dealt with transparency, it was overridden directly in a custom block class. Thanks!

Ah, I've never been very good at clarity, my bad. Glad you got it working!

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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