Posted February 3, 20205 yr So, I'm having an... interesting bug, and, after about an hour, I'm not sure what's causing it. My rose texture is normal and transparent when held or in an item frame, but when placed, the transparency becomes black. I'm not sure if this is simply a bug with Forge, or if something significant changed from 1.15.1 to 1.15.2. I'm modding with version 31.0.16. Blockstate: { "variants": { "": { "model": "[NAMESPACE HERE]:block/rose" } } } Block Model: { "parent": "block/cross", "textures": { "cross": "[NAMESPACE HERE]:block/rose" } } Item Model: { "parent": "item/generated", "textures": { "layer0": "[NAMESPACE HERE]:block/rose" } } Item Registration (Not sure if this has anything to do with it because it's actually just a FlowerBlock): new BlockItem(ModBlocks.rose, new Item.Properties().maxStackSize(64).group(ItemGroup.DECORATIONS)).setRegistryName("[NAMESPACE HERE]", "rose"), Thanks in advance! ? Edited February 3, 20205 yr by MattNL
February 3, 20205 yr You didn't set your block (in the java code) to be transparent. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 3, 20205 yr Author Okay, so in my block registry? If so, how? I tried looking at vanilla's code, but my registry resembles other small flowers' registries... so either I'm missing something, or I'm just stupid. Edited February 3, 20205 yr by MattNL
February 3, 20205 yr Well, what class does your block use? You showed your item registration, but not your block code. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 3, 20205 yr Author That might be useful, huh? new FlowerBlock(Effects.SPEED, 6, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().hardnessAndResistance(0.0F).sound(SoundType.PLANT)).setRegistryName("[NAMESPACE HERE]", "rose")
February 3, 20205 yr Ok, I'm not sure. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 6, 20205 yr Author That helped a lot! This is how I implemented it. I slightly modified the registerBlock function from here (Biomes of Plenty Mod [by Glitchfiend]): https://github.com/Glitchfiend/BiomesOPlenty/commit/7b727bfbcfb9307a6d15efa15893fdd8f7721cd4 Here is a cropped sample of code for those struggling with the issue: public static Block rose = null; public static Block cyan_flower = null; @Mod.EventBusSubscriber(modid = "[NAMESPACE HERE]", bus = Mod.EventBusSubscriber.Bus.MOD) @ObjectHolder("[NAMESPACE HERE]") public class ModBlocks { rose = registerBlock(new FlowerBlock(Effects.SPEED, 6, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().hardnessAndResistance(0.0F).sound(SoundType.PLANT)), "[NAMESPACE HERE]", "rose"); cyan_flower = registerBlock(new FlowerBlock(Effects.SPEED, 6, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().hardnessAndResistance(0.0F).sound(SoundType.PLANT)), "[NAMESPACE HERE]", "cyan_flower"); if (FMLEnvironment.dist == Dist.CLIENT) { RenderTypeLookup.setRenderLayer(rose, RenderType.func_228643_e_()); RenderTypeLookup.setRenderLayer(cyan_flower, RenderType.func_228643_e_()); } } public static Block registerBlock(Block block, String namespace, String name) { block.setRegistryName(namespace, name); ForgeRegistries.BLOCKS.register(block); return block; } For anyone who wants the functions for all of the RenderTypes: func_228639_c_ = SOLID func_228641_d_ = CUTOUT_MIPPED func_228643_e_ = CUTOUT func_228645_f_ = TRANSLUCENT func_228647_g_ = TRANSLUCENT_NO CRUMBLING func_228649_h_ = LEASH func_228651_i_ = WATER_MASK func_228653_j_ = GLINT func_228655_k_ = ENTITY GLINT func_228657_l_ = LIGHTNING I hope this can be useful to anyone else struggling with the same issue! Thanks very much! Edited February 6, 20205 yr by MattNL Slightly modified code to have better flexibility
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.