Jump to content

Recommended Posts

Posted

I keep erros like this 

Exception loading blockstate definition: 'armourandtoolsmod:blockstates/ruby_ore.json' missing model for variant: 'armourandtoolsmod:ruby_ore#facing=north'

I dont know the cause. Here is my block state data gen code

public class ModBlockStateProvider extends BlockStateProvider {
    public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
        super(output, MOD_ID, exFileHelper);
    }

    @Override
    public @NotNull String getName() {
        return "Armour and Tools Mod Blockstates";
    }

    @Override
    protected void registerStatesAndModels() {
        normalBlock(BlockInit.RUBY_ORE.get());
        normalBlock(BlockInit.RAINBOW_ORE.get());
        normalBlock(BlockInit.SAPPHIRE_ORE.get());
        normalBlock(BlockInit.GRAPHITE_ORE.get());
        normalBlock(BlockInit.AQUMARINE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RUBY_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RAINBOW_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_SAPPHIRE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_GRAPHITE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_AQUMARINE_ORE.get());
        normalBlock(BlockInit.RUBY_BLOCK.get());
        normalBlock(BlockInit.RAINBOW_BLOCK.get());
        normalBlock(BlockInit.SAPPHIRE_BLOCK.get());
        normalBlock(BlockInit.GRAPHITE_BLOCK.get());
        normalBlock(BlockInit.AQUMARINE_BLOCK.get());
    }

    public void normalBlock(Block block) {
        ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block);

        if (name == null) {
            ArmourAndToolsMod.logger.error("Could not find block key for " + block.getName());
            return;
        }

        BlockModelBuilder builder =
                this.models().withExistingParent(name.getPath(), "block/cube_all");
        builder.texture("all", modLoc("block/" + name.getPath()));
        this.simpleBlockItem(block, builder);
        this.simpleBlock(block, builder);
    }
}

 

Posted (edited)

None of generated resource's work


My main class

 

@Mod(MOD_ID)
public class ArmourAndToolsMod {
    public static final Logger logger = LoggerFactory.getLogger(ArmourAndToolsMod.class);
    public static final String MOD_ID = "armourandtoolsmod";

    public ArmourAndToolsMod() {
        var bus = FMLJavaModLoadingContext.get().getModEventBus();
        ItemInit.ITEMS.register(bus);
        BlockInit.BLOCKS.register(bus);

        // Register the item to a creative tab
        bus.addListener(ArmourAndToolsGroup::registerCreativeTab);
        // Register the data generators
        bus.addListener(DataGenerators::gatherData);

        // Register the mod to the event bus
        MinecraftForge.EVENT_BUS.register(this);
        logger.info("Hello from RealYusufismail's Armour and Tools Mod!");
    }
}

 

Edited by yusufgamer
Posted

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
  Quote

Missing metadata in pack

Expand  

i.e. your resource/datapack metadata

 

You have a invalid space (%20) at the beginning of the file name.

https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/changed_to_java/src/main/resources/ pack.mcmeta

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 (edited)

I tried adding the varient but still get the same error

My gh repo url : https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/tree/changed_to_java/src/main/java/io/github/realyusufismail/armourandtoolsmod

public class ModBlockStateProvider extends BlockStateProvider {
    public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
        super(output, MOD_ID, exFileHelper);
    }

    @Override
    public @NotNull String getName() {
        return "Armour and Tools Mod Blockstates";
    }

    @Override
    protected void registerStatesAndModels() {
        normalBlock(BlockInit.RUBY_ORE.get());
        normalBlock(BlockInit.RAINBOW_ORE.get());
        normalBlock(BlockInit.SAPPHIRE_ORE.get());
        normalBlock(BlockInit.GRAPHITE_ORE.get());
        normalBlock(BlockInit.AQUMARINE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RUBY_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RAINBOW_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_SAPPHIRE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_GRAPHITE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_AQUMARINE_ORE.get());
        normalBlock(BlockInit.RUBY_BLOCK.get());
        normalBlock(BlockInit.RAINBOW_BLOCK.get());
        normalBlock(BlockInit.SAPPHIRE_BLOCK.get());
        normalBlock(BlockInit.GRAPHITE_BLOCK.get());
        normalBlock(BlockInit.AQUMARINE_BLOCK.get());
    }

    public void normalBlock(Block block) {
        ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block);

        if (name == null) {
            ArmourAndToolsMod.logger.error("Could not find block key for " + block.getName());
            return;
        }

        String path = name.getPath();

        BlockModelBuilder builder = models().cubeAll(path, modLoc("block/" + path));
        getVariantBuilder(block)
            .forAllStates(state -> ConfiguredModel.builder().modelFile(builder).build());
    }
}

 

Edited by yusufgamer
Posted

People that;

* post "it doesn't work" instead of showing the actual error.

* don't include all the information  https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/f8f865ef0c94cfe54d3847d398ee9f533cf94379/src/main/java/io/github/realyusufismail/armourandtoolsmod/core/init/BlockInit.java#L21

* spend less than 30 minutes trying to figure it out for themselves and instead expect others to do their work for them

will usually just be ignored. 

I could try to guess what the problem is, but with such incomplete information I would likely be wrong, so I won't.

 

I've answered a number of your problems recently and the last few were trivial typos in your code which tells me you are putting little effort into trying to debug it for yourself.

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.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • You will find the crash-report or log in your minecraft directory (crash-report or logs folder)
    • Use a modpack which is using these 2 mods as working base:   https://www.curseforge.com/minecraft/modpacks/life-in-the-village-3
    • inicie un mundo donde instale Croptopia y Farmer's Delight, entonces instale el addon Croptopia Delight pero no funciona. es la version 1.18.2
    • Hello all. I'm currently grappling with the updateShape method in a custom class extending Block.  My code currently looks like this: The conditionals in CheckState are there to switch blockstate properties, which is working fine, as it functions correctly every time in getStateForPlacement.  The problem I'm running into is that when I update a state, the blocks seem to call CheckState with the position of the block which was changed updated last.  If I build a wall I can see the same change propagate across. My question thus is this: is updateShape sending its return to the neighbouring block?  Is each block not independently executing the updateShape method, thus inserting its own current position?  The first statement appears to be true, and the second false (each block is not independently executing the method). I have tried to fix this by saving the block's own position to a variable myPos at inception, and then feeding this in as CheckState(myPos) but this causes a worse outcome, where all blocks take the update of the first modified block, rather than just their neighbour.  This raises more questions than it answers, obviously: how is a different instance's variable propagating here?  I also tried changing it so that CheckState did not take a BlockPos, but had myPos built into the body - same problem. I have previously looked at neighbourUpdate and onNeighbourUpdate, but could not find a way to get this to work at all.  One post on here about updatePostPlacement and other methods has proven itself long superceded.  All other sources on the net seem to be out of date. Many thanks in advance for any help you might offer me, it's been several days now of trying to get this work and several weeks of generally trying to get round this roadblock.  - Sandermall
    • sorry, I might be stupid, but how do I open it? because the only options I have are too X out, copy it, which doesn't work and send crash report, which doesn't show it to me, also, sorry for taking so long.
  • Topics

×
×
  • Create New...

Important Information

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