Jump to content

Recommended Posts

Posted

Minecraft version:1.16.5(STABLE)

Forge version:36.2.34

IDE:Intellij 2022.3

Project REPO : https://www.github.com/lucaiyu/TouhouCraft

I tried to add a block with 2 blocks but the texture not render at all.

This is the block code

package com.lucaiyu.touhoucraft.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.state.IntegerProperty;
import net.minecraft.state.StateContainer;

public class ShrineToriiTitle extends Block {
    private static IntegerProperty STATE = IntegerProperty.create("char", 0, 1);

    public ShrineToriiTitle() {
        super(Properties.of(Material.STONE).sound(SoundType.STONE).strength(5.0F,5.0F));

        this.registerDefaultState(this.stateDefinition.any().setValue(STATE, 0));
    }

    @Override
    protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
        builder.add(STATE);
    }
}

This is the block registry

package com.lucaiyu.touhoucraft.blocks;

import com.lucaiyu.touhoucraft.TouHouCraft;
import net.minecraft.block.Block;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class BlockRegistry {
    public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, TouHouCraft.MOD_ID);
    public static RegistryObject<Block> touhou_crystal_ore = BLOCKS.register("touhou_crystal_ore", () -> {
        return new TouhouCrystalOre();
    });
    public static RegistryObject<Block> magic_ore = BLOCKS.register("magic_ore",()->{
        return new MagicOre();
    });
    public static RegistryObject<Block> shrine_torii_title = BLOCKS.register("shrine_torii_title",()->{
        return new ShrineToriiTitle();
    });
    public static RegistryObject<Block> touhou_crystal_ore_in_nether = BLOCKS.register("touhou_crystal_ore_in_nether",()->{
        return new TouhouCrystalOreInNether();
    });
    public static RegistryObject<Block> magic_ore_in_nether = BLOCKS.register("magic_ore_in_nether",()->{
        return new MagicOreInNether();
    });
}

This is the main class

package com.lucaiyu.touhoucraft;

import com.lucaiyu.touhoucraft.blocks.BlockRegistry;
import com.lucaiyu.touhoucraft.items.ItemRegistry;

import com.lucaiyu.touhoucraft.world.gen.OreGeneration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;


@Mod("touhoucraft")
public class TouHouCraft{
    public static String MOD_ID = "touhoucraft";
    public TouHouCraft() {
        ItemRegistry.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        BlockRegistry.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
        MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, OreGeneration::generateOres);
    }


}

this is the texture pack blockstates

{
  "variants": {
    "": {
      "char=0": {
        "model": "shrine_torii_title_model_0"
      },
      "char=1": {
        "model": "shrine_torii_title_model_1"
      }
    }
  }
}

These are 

{
  "parent": "minecraft:block/cube_column",
  "textures": {
    "end": "touhoucraft:block/blank",
    "side": "touhoucraft:block/char0"
  }
}
/*these are two files*/
{
  "parent": "minecraft:block/cube_column",
  "textures": {
    "end": "touhoucraft:block/blank",
    "side": "touhoucraft:block/char1"
  }
}

 

Posted

Look at the warnings on your console or in the log. It should tell you what is "missing".

One problem I can see is 

  "model": "shrine_torii_title_model_0"

Should probably be something like:

  "model": "touhoucraft:block/shrine_torii_title_model_0"

But only you know the correct names.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted

Something wrong

The texture still not loaded

[21:14:33] [Worker-Main-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'touhoucraft:blockstates/shrine_torii_title.json' missing model for variant: 'touhoucraft:shrine_torii_title#char=1'
[21:14:33] [Worker-Main-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'touhoucraft:blockstates/shrine_torii_title.json' missing model for variant: 'touhoucraft:shrine_torii_title#char=0'
[21:14:33] [Worker-Main-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'touhoucraft:blockstates/shrine_torii_title.json' in resourcepack: 'Mod Resources': Missing model, expected to find a string
[21:14:34] [Worker-Main-6/WARN] [minecraft/ModelBakery]: Unable to load model: 'touhoucraft:block/shrine_torii_title_model' referenced from: touhoucraft:shrine_torii_title#inventory: java.io.FileNotFoundException: touhoucraft:models/block/shrine_torii_title_model.json
[21:14:36] [Worker-Main-6/WARN] [minecraft/ModelBakery]: Unable to resolve texture reference: #missingno in touhoucraft:item/shrine_torii_title

This is the blockstate code

{
  "variants": {
    "": {
      "char=0": {
        "model": "touhoucraft:block/shrine_torii_title_model_0"
      },
      "char=1": {
        "model": "touhoucraft:block/shrine_torii_title_model_1"
      }
    }
  }
}

Blockstate in my code is int format and includes 0 and 1

I think something wrong in the resource pack

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

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