I am programming a leaf block into my mod. I added it as normal but upon opening the game all transparent sections are shown as black. I have read up on this and tried many different solutions and nothing has worked here is my code:
Registry Handler:
public static void init() {
ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
}
// BLOCKS
public static final RegistryObject<Block> SILVER_LEAVES = BLOCKS.register("silver_leaves", SilverLeaves::new);
// BLOCK ITEM
public static final RegistryObject<Item> SILVER_LEAVES_ITEM = ITEMS.register("silver_leaves", () -> new BlockItemBase(SILVER_LEAVES.get()));
private static Block register(String key, Block blockIn) {
return Registry.register(Registry.BLOCK, key, blockIn);
}
}
SilverLeaves.java
package com.Cyanideee.UDWM.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.common.extensions.IForgeBlockState;
public class SilverLeaves extends Block {
public SilverLeaves() {
super(Properties.create(Material.LEAVES)
.hardnessAndResistance(0.2f, 0.2f)
.sound(SoundType.PLANT)
.notSolid()
);
}
}
{
"parent": "block/leaves",
"textures": {
"all": "udwm:blocks/silver_leaves"
}
}