Jump to content

[1.15.1] Transparent Blocks, Arn't


Ommina

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 weeks later...
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

Link to comment
Share on other sites

  • 5 weeks later...
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
Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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)

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa OLXTOTO telah menetapkan standar baru dalam dunia perjudian dengan menjadi platform terbesar untuk pengalaman gaming yang penuh kemenangan dan kegacoran, sepanjang masa. Dengan fokus yang kuat pada menyediakan permainan yang menghadirkan kesenangan tanpa batas dan peluang kemenangan besar, OLXTOTO telah menjadi pilihan utama bagi para pencinta judi berani di Indonesia. Maxwin: Mengejar Kemenangan Terbesar Maxwin bukan sekadar kata-kata kosong di OLXTOTO. Ini adalah konsep yang ditanamkan dalam setiap aspek permainan yang mereka tawarkan. Dari permainan slot yang menghadirkan jackpot besar hingga berbagai opsi permainan togel dengan hadiah fantastis, para pemain dapat memperoleh peluang nyata untuk mencapai kemenangan terbesar dalam setiap taruhan yang mereka lakukan. OLXTOTO tidak hanya menawarkan kesempatan untuk menang, tetapi juga menjadi wadah bagi para pemain untuk meraih impian mereka dalam perjudian yang berani. Gacor: Keberuntungan yang Tak Tertandingi Keberuntungan seringkali menjadi faktor penting dalam perjudian, dan OLXTOTO memahami betul akan hal ini. Dengan berbagai strategi dan analisis yang disediakan, pemain dapat menemukan peluang gacor yang tidak tertandingi dalam setiap taruhan. Dari hasil togel yang tepat hingga putaran slot yang menguntungkan, OLXTOTO memastikan bahwa setiap taruhan memiliki potensi untuk menjadi momen yang mengubah hidup. Inovasi dan Kualitas Tanpa Batas Tidak puas dengan prestasi masa lalu, OLXTOTO terus berinovasi untuk memberikan pengalaman gaming terbaik kepada para pengguna. Dengan menggabungkan teknologi terbaru dengan desain yang ramah pengguna, platform ini menyajikan antarmuka yang mudah digunakan tanpa mengorbankan kualitas. Setiap pembaruan dan peningkatan dilakukan dengan tujuan tunggal: memberikan pengalaman gaming yang tanpa kompromi kepada setiap pengguna. Komitmen Terhadap Kepuasan Pelanggan Di balik kesuksesan OLXTOTO adalah komitmen mereka terhadap kepuasan pelanggan. Tim dukungan pelanggan yang profesional siap membantu para pemain dalam setiap langkah perjalanan gaming mereka. Dari pertanyaan teknis hingga bantuan dengan transaksi keuangan, OLXTOTO selalu siap memberikan pelayanan terbaik kepada para pengguna mereka. Penutup: Mengukir Sejarah dalam Dunia Perjudian Daring OLXTOTO bukan sekadar platform perjudian berani biasa. Ini adalah ikon dalam dunia perjudian daring Indonesia, sebuah destinasi yang menyatukan kemenangan dan keberuntungan dalam satu tempat yang mengasyikkan. Dengan komitmen mereka terhadap kualitas, inovasi, dan kepuasan pelanggan, OLXTOTO terus mengukir sejarah dalam perjudian dunia berani, menjadi nama yang tak terpisahkan dari pengalaman gaming terbaik. Bersiaplah untuk mengalami sensasi kemenangan terbesar dan keberuntungan tak terduga di OLXTOTO - platform maxwin dan gacor terbesar sepanjang masa.
    • OLXTOTO - Bandar Togel Online Dan Slot Terbesar Di Indonesia OLXTOTO telah lama dikenal sebagai salah satu bandar online terkemuka di Indonesia, terutama dalam pasar togel dan slot. Dengan reputasi yang solid dan pengalaman bertahun-tahun, OLXTOTO menawarkan platform yang aman dan andal bagi para penggemar perjudian daring. DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI Beragam Permainan Togel Sebagai bandar online terbesar di Indonesia, OLXTOTO menawarkan berbagai macam permainan togel. Mulai dari togel Singapura, togel Hongkong, hingga togel Sidney, pemain memiliki banyak pilihan untuk mencoba keberuntungan mereka. Dengan sistem yang transparan dan hasil yang adil, OLXTOTO memastikan bahwa setiap taruhan diproses dengan cepat dan tanpa keadaan. Slot Online Berkualitas Selain togel, OLXTOTO juga menawarkan berbagai permainan slot online yang menarik. Dari slot klasik hingga slot video modern, pemain dapat menemukan berbagai opsi permainan yang sesuai dengan preferensi mereka. Dengan grafis yang memukau dan fitur bonus yang menggiurkan, pengalaman bermain slot di OLXTOTO tidak akan pernah membosankan. Keamanan dan Kepuasan Pelanggan Terjamin Keamanan dan kepuasan pelanggan merupakan prioritas utama di OLXTOTO. Mereka menggunakan teknologi enkripsi terbaru untuk melindungi data pribadi dan keuangan para pemain. Tim dukungan pelanggan yang ramah dan responsif siap membantu pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Promosi dan Bonus Menarik OLXTOTO sering menawarkan promosi dan bonus menarik kepada para pemainnya. Mulai dari bonus selamat datang hingga bonus deposit, pemain memiliki kesempatan untuk meningkatkan kemenangan mereka dengan memanfaatkan berbagai penawaran yang tersedia. Penutup Dengan reputasi yang solid, beragam permainan berkualitas, dan komitmen terhadap keamanan dan kepuasan pelanggan, OLXTOTO tetap menjadi salah satu pilihan utama bagi para pecinta judi online di Indonesia. Jika Anda mencari pengalaman berjudi yang menyenangkan dan terpercaya, OLXTOTO layak dipertimbangkan.
    • I have been having a problem with minecraft forge. Any version. Everytime I try to launch it it always comes back with error code 1. I have tried launching from curseforge, from the minecraft launcher. I have also tried resetting my computer to see if that would help. It works on my other computer but that one is too old to run it properly. I have tried with and without mods aswell. Fabric works, optifine works, and MultiMC works aswell but i want to use forge. If you can help with this issue please DM on discord my # is Haole_Dawg#6676
    • Add the latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • I have no idea how a UI mod crashed a whole world but HUGE props to you man, just saved me +2 months of progress!  
  • Topics

×
×
  • Create New...

Important Information

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