Jump to content

Recommended Posts

Posted (edited)

Hi, I've created a custom stair based on the StairsBlock() function and it cause this issue:

2020-05-01_16_01_53.png.2c73c72a3535dbad19240df40338cb8f.png

 

This is the code:

Spoiler

package fr.theskilllesss.minaria.init;

import com.google.common.collect.Lists;
import fr.theskilllesss.minaria.MineriaMod;
import fr.theskilllesss.minaria.blocks.BlockMineria;
import fr.theskilllesss.minaria.blocks.BougainvilleaSaplingBlock;
import fr.theskilllesss.minaria.world.feature.BougainvilleaTreeFeature;
import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import java.util.List;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = MineriaMod.MODID)
public class ModBlocks {
    public static final ModBlocks INSTANCE = new ModBlocks();

    public static List<Block> blocks;
    public static List<BlockItem> blockitems;


    public static Block blue_emerald_block;
    public static Block larimar_ore;
    public static Block elevator_block;

    public static Block bougainvillea_planks, bougainvillea_leaves, bougainvillea_log, bougainvillea_sapling, bougainvillea_stairs, bougainvillea_fence;

    private static void init(){

        blocks = Lists.newArrayList();
        blockitems = Lists.newArrayList();

        blue_emerald_block = new BlockMineria("blue_emerald_block", Block.Properties.create(Material.IRON).hardnessAndResistance(5f, 20f));
        elevator_block = new BlockMineria("elevator_block", Block.Properties.create(Material.ROCK).hardnessAndResistance(3f, 10f).harvestTool(ToolType.PICKAXE).harvestLevel(1).sound(SoundType.STONE));
        larimar_ore = new BlockMineria("larimar_ore", Block.Properties.create(Material.ROCK).hardnessAndResistance(3f, 10f).harvestTool(ToolType.PICKAXE).harvestLevel(1).sound(SoundType.STONE));

        bougainvillea_planks = new BlockMineria("bougainvillea_planks", Block.Properties.from(Blocks.OAK_PLANKS));
    }

    @SubscribeEvent
    public static void registerBlock(RegistryEvent.Register<Block> e){
        init();

        e.getRegistry().registerAll(
                bougainvillea_leaves = new LeavesBlock(Block.Properties.from(Blocks.OAK_LEAVES)).setRegistryName("bougainvillea_leaves"),
                bougainvillea_log = new LogBlock(MaterialColor.WOOD, Block.Properties.from(Blocks.OAK_PLANKS)).setRegistryName("bougainvillea_log"),
                bougainvillea_sapling = new BougainvilleaSaplingBlock(() -> new BougainvilleaTreeFeature(), Block.Properties.from(Blocks.OAK_SAPLING)).setRegistryName("bougainvillea_sapling"),
                bougainvillea_stairs = new StairsBlock(()->bougainvillea_planks.getDefaultState(), Block.Properties.from(bougainvillea_planks)).setRegistryName("bougainvillea_stairs"),
                bougainvillea_fence = new FenceBlock(Block.Properties.from(bougainvillea_planks)).setRegistryName("bougainvillea_fence")
        );

        for(Block b : blocks){
            e.getRegistry().register(b);
        }
    }

    @SubscribeEvent
    public static void RegisterBlockItems(RegistryEvent.Register<Item> e){
        e.getRegistry().registerAll(
                new BlockItem(bougainvillea_leaves, new Item.Properties().group(MineriaMod.MODGROUP)).setRegistryName("bougainvillea_leaves"),
                new BlockItem(bougainvillea_log, new Item.Properties().group(MineriaMod.MODGROUP)).setRegistryName("bougainvillea_log"),
                new BlockItem(bougainvillea_sapling, new Item.Properties().group(MineriaMod.MODGROUP)).setRegistryName("bougainvillea_sapling"),
                new BlockItem(bougainvillea_stairs, new Item.Properties().group(MineriaMod.MODGROUP)).setRegistryName("bougainvillea_stairs"),
                new BlockItem(bougainvillea_fence, new Item.Properties().group(MineriaMod.MODGROUP)).setRegistryName("bougainvillea_fence")
        );

        for(BlockItem bi : blockitems){
            e.getRegistry().register(bi);
        }
    }

}

 

The differents Json things (BlockState, Stairs, InnerStairs, OuterStairs and the Item thing):

Spoiler

{
    "variants": {
        "facing=east,half=bottom,shape=straight":  { "model": "mineriamod:/block/bougainvillea_stairs" },
        "facing=west,half=bottom,shape=straight":  { "model": "mineriamod:/block/bougainvillea_stairs", "y": 180, "uvlock": true },
        "facing=south,half=bottom,shape=straight": { "model": "mineriamod:/block/bougainvillea_stairs", "y": 90, "uvlock": true },
        "facing=north,half=bottom,shape=straight": { "model": "mineriamod:/block/bougainvillea_stairs", "y": 270, "uvlock": true },
        "facing=east,half=bottom,shape=outer_right":  { "model": "mineriamod:/block/bougainvillea_stairs_outer" },
        "facing=west,half=bottom,shape=outer_right":  { "model": "mineriamod:/block/bougainvillea_stairs_outer", "y": 180, "uvlock": true },
        "facing=south,half=bottom,shape=outer_right": { "model": "mineriamod:/block/bougainvillea_stairs_outer", "y": 90, "uvlock": true },
        "facing=north,half=bottom,shape=outer_right": { "model": "mineriamod:/block/bougainvillea_stairs_outer", "y": 270, "uvlock": true },
        "facing=east,half=bottom,shape=outer_left":  { "model": "mineriamod:/block/bougainvillea_stairs_outer", "y": 270, "uvlock": true },
        "facing=west,half=bottom,shape=outer_left":  { "model": "mineriamod:/block/bougainvillea_stairs_outer", "y": 90, "uvlock": true },
        "facing=south,half=bottom,shape=outer_left": { "model": "mineriamod:/block/bougainvillea_stairs_outer" },
        "facing=north,half=bottom,shape=outer_left": { "model": "mineriamod:/block/bougainvillea_stairs_outer", "y": 180, "uvlock": true },
        "facing=east,half=bottom,shape=inner_right":  { "model": "mineriamod:/block/bougainvillea_stairs_inner" },
        "facing=west,half=bottom,shape=inner_right":  { "model": "mineriamod:/block/bougainvillea_stairs_inner", "y": 180, "uvlock": true },
        "facing=south,half=bottom,shape=inner_right": { "model": "mineriamod:/block/bougainvillea_stairs_inner", "y": 90, "uvlock": true },
        "facing=north,half=bottom,shape=inner_right": { "model": "mineriamod:/block/bougainvillea_stairs_inner", "y": 270, "uvlock": true },
        "facing=east,half=bottom,shape=inner_left":  { "model": "mineriamod:/block/bougainvillea_stairs_inner", "y": 270, "uvlock": true },
        "facing=west,half=bottom,shape=inner_left":  { "model": "mineriamod:/block/bougainvillea_stairs_inner", "y": 90, "uvlock": true },
        "facing=south,half=bottom,shape=inner_left": { "model": "mineriamod:/block/bougainvillea_stairs_inner" },
        "facing=north,half=bottom,shape=inner_left": { "model": "mineriamod:/block/bougainvillea_stairs_inner", "y": 180, "uvlock": true },
        "facing=east,half=top,shape=straight":  { "model": "mineriamod:/block/bougainvillea_stairs", "x": 180, "uvlock": true },
        "facing=west,half=top,shape=straight":  { "model": "mineriamod:/block/bougainvillea_stairs", "x": 180, "y": 180, "uvlock": true },
        "facing=south,half=top,shape=straight": { "model": "mineriamod:/block/bougainvillea_stairs", "x": 180, "y": 90, "uvlock": true },
        "facing=north,half=top,shape=straight": { "model": "mineriamod:/block/bougainvillea_stairs", "x": 180, "y": 270, "uvlock": true },
        "facing=east,half=top,shape=outer_right":  { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "y": 90, "uvlock": true },
        "facing=west,half=top,shape=outer_right":  { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "y": 270, "uvlock": true },
        "facing=south,half=top,shape=outer_right": { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "y": 180, "uvlock": true },
        "facing=north,half=top,shape=outer_right": { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "uvlock": true },
        "facing=east,half=top,shape=outer_left":  { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "uvlock": true },
        "facing=west,half=top,shape=outer_left":  { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "y": 180, "uvlock": true },
        "facing=south,half=top,shape=outer_left": { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "y": 90, "uvlock": true },
        "facing=north,half=top,shape=outer_left": { "model": "mineriamod:/block/bougainvillea_stairs_outer", "x": 180, "y": 270, "uvlock": true },
        "facing=east,half=top,shape=inner_right":  { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "y": 90, "uvlock": true },
        "facing=west,half=top,shape=inner_right":  { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "y": 270, "uvlock": true },
        "facing=south,half=top,shape=inner_right": { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "y": 180, "uvlock": true },
        "facing=north,half=top,shape=inner_right": { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "uvlock": true },
        "facing=east,half=top,shape=inner_left":  { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "uvlock": true },
        "facing=west,half=top,shape=inner_left":  { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "y": 180, "uvlock": true },
        "facing=south,half=top,shape=inner_left": { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "y": 90, "uvlock": true },
        "facing=north,half=top,shape=inner_left": { "model": "mineriamod:/block/bougainvillea_stairs_inner", "x": 180, "y": 270, "uvlock": true }
    }
}

 

Spoiler

{
    "parent": "block/stairs",
    "textures": {
        "bottom": "mineriamod:block/bougainvillea_planks",
        "top": "mineriamod:block/bougainvillea_planks",
        "side": "mineriamod:block/bougainvillea_planks"
    }
}

 

Spoiler

{
    "parent": "block/inner_stairs",
    "textures": {
        "bottom": "mineriamod:block/bougainvillea_stairs",
        "top": "mineriamod:block/bougainvillea_stairs",
        "side": "mineriamod:block/bougainvillea_stairs"
    }
}

 

Spoiler

{
    "parent": "block/outer_stairs",
    "textures": {
        "bottom": "mineriamod:block/bougainvillea_stairs",
        "top": "mineriamod:block/bougainvillea_stairs",
        "side": "mineriamod:block/bougainvillea_stairs"
    }
}

 

Spoiler

{
	"parent": "mineriamod:block/bougainvillea_stairs"
}

 

 

Edited by TheSkillLesss
Posted

Hi

Looks like some of your model files don't match the blockstate names.  The item is ok, and some of the placed blocks, but others aren't.

Check the console log, it might have some clues for you.

 

-TGG

Posted (edited)

I am just an idiot, I referred my stairs inner and my stairs outer texture to a stair texture that don't exist:

{
    "parent": "block/outer_stairs",
    "textures": {
        "bottom": "mineriamod:block/bougainvillea_stairs",
        "top": "mineriamod:block/bougainvillea_stairs",
        "side": "mineriamod:block/bougainvillea_stairs"
    }
}

in place of

{
    "parent": "block/outer_stairs",
    "textures": {
        "bottom": "mineriamod:block/bougainvillea_planks",
        "top": "mineriamod:block/bougainvillea_planks",
        "side": "mineriamod:block/bougainvillea_planks"
    }
}

thanks you !

Edited by TheSkillLesss

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



×
×
  • Create New...

Important Information

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