Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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"),

 

2020-02-02_19.36.10.png

 

Thanks in advance! ?

Edited by MattNL

  • MattNL changed the title to [1.15.2] A texture issue with cross models?

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.

  • 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 by MattNL

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.

  • 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")

 

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.

  • 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!

2020-02-05_19.10.30.png

Edited by MattNL
Slightly modified code to have better flexibility

  • MattNL changed the title to [SOLVED] [1.15.2] A texture issue with cross models?

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.