Jump to content

Recommended Posts

Posted (edited)

Perhaps it's too early to start asking about 1.15.1 rending changes.  But I'm going to anyway.

 

I've created a test mod with exactly one block.  Said block is merely an instance of the vanilla GlassBlock, using the vanilla Block.Properties (copied from Blocks):

 

Block b = new GlassBlock( Block.Properties.create( Material.GLASS ).hardnessAndResistance( 0.3F ).sound( SoundType.GLASS ).func_226896_b_() );
b.setRegistryName( "testglass" );
event.getRegistry().register( b );

 

Test Mod has one BlockItem for its lonely block:

 

event.getRegistry().register( new BlockItem( TESTGLASSBLOCK, new Item.Properties().group( ItemGroup.MISC ).maxStackSize( 64 ) ).setRegistryName( "testglass" ) );

 

And that's it.

 

Yet they render dramatically different:

 

https://imgur.com/a/UEcagsa

 

Texture is a copy/paste of vanilla's.  Item version DOES render fine in inventory.

 

Am I missing something here?  Or am I just experiencing the consequences of a lot of rendering changes within a very new Forge release?

Edited by Ommina
Posted

I'm not a fan of bumping my own posts, but I want to throw this out here again before taking it to the bug tracker.

 

I've taken as much mod code out as I can, while still demonstrating my issue.  The whole code:

 

@Mod( "examplemod" )
@ObjectHolder( "examplemod" )
public class ExampleMod {

    @ObjectHolder( "testglass" ) public static Block TESTGLASSBLOCK;

    public ExampleMod() {

        MinecraftForge.EVENT_BUS.register( this );
    }

    @Mod.EventBusSubscriber( bus = Mod.EventBusSubscriber.Bus.MOD )
    public static class RegistryEvents {

        @SubscribeEvent
        public static void onBlocksRegistry( final RegistryEvent.Register<Block> event ) {

            Block b = new GlassBlock( Block.Properties.create( Material.GLASS ).hardnessAndResistance( 0.3F ).sound( SoundType.GLASS ).func_226896_b_() );
            b.setRegistryName( "testglass" );
            event.getRegistry().register( b );

        }

        @SubscribeEvent
        public static void onItemsRegistry( final RegistryEvent.Register<Item> event ) {

            event.getRegistry().register( new BlockItem( TESTGLASSBLOCK, new Item.Properties().group( ItemGroup.MISC ).maxStackSize( 64 ) ).setRegistryName( "testglass" ) );

        }

    }

}

 

With one blockstate json that points to the vanilla model:

 

{
  "variants": {
    "": { "model": "minecraft:block/glass" }
  }
}

 

And one item model json:

 

{
  "parent": "minecraft:block/glass"
}

 

And that's it.

 

https://github.com/Ommina/PaneInTheGlass if anybody is excited by a GitHub repository of the above.

Posted
On 12/20/2019 at 6:56 PM, Ommina said:

 


{
  "variants": {
    "": { "model": "minecraft:block/glass" }
  }
}

Shouldnt it be "examplemod":block/testglass

Because your using the model in your model json

 

And it might be because you did block.properties.glass

Posted

Nope, I'm deliberately using the vanilla model because I want to remove as much mod code from the equation as I can.  So 'examplemod' blockstate points into vanilla's model, which in turn uses vanilla's texture.  (I did try using a mod model and a copy of the texture originally, but it made no difference.)

 

The Block.Properties.create( Material.GLASS ) bit is likewise a copy/paste of how vanilla creates its glass block.  I don't think there is some Forge-added Material that modders are supposed to use instead (it seems rather odd if there were), but I'll take a peek just the same.

Posted

You need to set the render layer using

RenderTypeLookup#setRenderLayer

within your FMLClientSetupEvent to make blocks transparent.

 

It takes in two parameters: the block and the RenderType.

The RenderTypes are as follows:

Solid - field_228615_R_

Cutout Mipped - field_228616_S_

Cutout - field_228617_T_

Translucent - field_228618_U_

Translucent (No Crumbling) - field_228619_V_

Leash - field_228620_W_

Water Mask - field_228621_X_

Glint - field_228622_Y_

Entity Glint - field_228623_Z_

Lightning - field_228624_aa_

 

What you are looking for is either cutout mipped or cutout so use either RenderType#field_228616_S_ or RenderType#field_228617_T_ to accomplish this.

  • Like 1
  • Thanks 4
  • 2 weeks later...
Posted
On 12/23/2019 at 5:33 AM, ChampionAsh5357 said:

You need to set the render layer using


RenderTypeLookup#setRenderLayer

within your FMLClientSetupEvent to make blocks transparent.

 

It takes in two parameters: the block and the RenderType.

The RenderTypes are as follows:

Solid - field_228615_R_

Cutout Mipped - field_228616_S_

Cutout - field_228617_T_

Translucent - field_228618_U_

Translucent (No Crumbling) - field_228619_V_

Leash - field_228620_W_

Water Mask - field_228621_X_

Glint - field_228622_Y_

Entity Glint - field_228623_Z_

Lightning - field_228624_aa_

 

What you are looking for is either cutout mipped or cutout so use either RenderType#field_228616_S_ or RenderType#field_228617_T_ to accomplish this.

Thanks bro you dope, you know dopes makes me high and its good, no but for real thank you

  • 5 weeks later...
Posted (edited)
On 12/22/2019 at 4:33 PM, ChampionAsh5357 said:

You need to set the render layer using


RenderTypeLookup#setRenderLayer

within your FMLClientSetupEvent to make blocks transparent.

 

It takes in two parameters: the block and the RenderType.

The RenderTypes are as follows:

Solid - field_228615_R_

Cutout Mipped - field_228616_S_

Cutout - field_228617_T_

Translucent - field_228618_U_

Translucent (No Crumbling) - field_228619_V_

Leash - field_228620_W_

Water Mask - field_228621_X_

Glint - field_228622_Y_

Entity Glint - field_228623_Z_

Lightning - field_228624_aa_

 

What you are looking for is either cutout mipped or cutout so use either RenderType#field_228616_S_ or RenderType#field_228617_T_ to accomplish this.

This is pretty helpful for me too, but what uses the RenderTypeLookup method in FMLClientSetupEvent? I can't find the method using the event or the block.

Edited by OrangeVillager61
Posted
On 2/4/2020 at 8:20 AM, OrangeVillager61 said:

This is pretty helpful for me too, but what uses the RenderTypeLookup method in FMLClientSetupEvent? I can't find the method using the event or the block.

What do you mean?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
On 12/23/2019 at 8:33 AM, ChampionAsh5357 said:

RenderTypeLookup#setRenderLayer

This means “an method called setRenderLayer in the class RenderTypeLookup”. (Usually “#” is the same as “.” but specifically means instance, however many people use “#”, “.” and “::” interchangeably which defeats their purpose).

 

On 2/4/2020 at 8:20 AM, OrangeVillager61 said:

This is pretty helpful for me too, but what uses the RenderTypeLookup method in FMLClientSetupEvent?

Your code will use RenderTypeLookup#setRenderLayer from inside the FMLClientSetupEvent.

 

RenderTypeLookup#setRenderLayer needs to be called after block registration on the client distribution so the FMLClientSetupEvent callback is the perfect place to call it. You need to be careful though as RenderTypeLookup and RenderType are client side only classes. This usually isn’t an issue as you’re using them inside a method that will only get called on the client, however, if you specify multiple RenderTypes for your via a lambda, you need to take extra precautions that your code isn’t loaded serverside because of how lambdas work. Therefore it’s best to subscribe to the FMLClientSetupEvent in a client only event subscriber (subscribed to the mod event bus obviously) rather than in your main class.

 

Since ChampionAsh wrote their response, mappings for 1.15.1 have been released. You should have updated your mappings to the latest (or latest stable) version and therefore should be referencing the mapped names not the SRG names in your source code.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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

    • Reach Out To Rapid Digital: What sapp Info: +1 41 4 80 7 14 85 Email INFO: rap iddi gita lrecov ery @ exe cs. com Hello, my name is Jayson, and I’m 35 years old from the United Kingdom. My family and I recently endured an incredibly challenging experience that I wouldn’t wish on anyone. We became victims of a cryptocurrency investment fraud scheme that saw us lose a staggering $807,000 in USDT and Bitcoins. The fraudsters had created a convincing facade, and we were lured into investing, only to discover later that the platform was a complete scam. We were left devastated, not just financially, but emotionally, as we had trusted these people and believed in the legitimacy of the investment. After the initial shock wore off, we desperately searched for ways to recover the lost funds. It seemed like an impossible task, and we felt as though there was no hope. That’s when, by sheer luck, we stumbled across a post about Rapid Digital Recovery, a cryptocurrency and funds recovery organization with a proven track record in cybersecurity and fraud recovery. We decided to reach out to them, and from the first interaction, we were impressed with their professionalism and transparency. They explained the recovery process in detail and reassured us that they had the skills and expertise to track down the perpetrators and recover our funds. This gave us a renewed sense of hope, something we hadn’t felt in months. What truly stood out during our experience with Rapid Digital Recovery was their dedication to the recovery process. The team went above and beyond, using sophisticated tracking tools and cyber forensics to gather critical information. Within a matter of weeks, they had successfully located the funds and traced the scam back to the fraudsters responsible. They worked with the authorities to ensure the criminals were held accountable for their actions. To our relief, the team at Rapid Digital Recovery was able to recover every single penny we had lost. The funds were returned in full, and the sense of closure we felt was invaluable. We couldn’t have imagined such a positive outcome in the early stages of our recovery journey, and we are deeply grateful for the work they did. If you ever find yourself in a similar situation, I highly recommend contacting Rapid Digital Recovery. Their expertise, transparency, and dedication to their clients make them the go-to choice for anyone seeking to recover lost cryptocurrency or funds. They truly gave us back our financial future.  
    • This is my first time modding anything, so maybe just skill issue. I'm using Forge 54.0.12 and Temurin 21.0.5+11-LTS I wanted to create a custom keybind and to check whether it works I'd like to send a chat message. I tried using Minecraft.getInstance().player.sendSystemMessage(Component.literal("test")); but IntelliJ couldnt resolve sendSystemMessage(...). Since I saw people using it in earlier versions, I tried the same thing with 1.20.6(- 50.1.0), where it works fine, now I can't figure out if this is intentional and whether there are other options for sending chat messages. On that note, is there more documentation than https://docs.minecraftforge.net/en/1.21.x/? It seems very incomplete compared to something like the Oracle Java docs
    • Hi, i'm having this error and I wanna fix it. we try: -Reload drivers -Eliminate .minecraft -Eliminate Java -Restart launcher -Verify if minecraft is using gpu -Mods  in .minecraft is empty -Install the latest and recomended version of forge idk what i have to do, help me pls. the lastest log is: https://mclo.gs/WAMao8x  
    • Read the FAQ, Rule #2. (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/)  
  • Topics

×
×
  • Create New...

Important Information

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