Jump to content

[1.13.2] Blockstates and Texture not Loading


chriss1998_15

Recommended Posts

Hello,

 

I recently got back into Modding and created my first Block with all the .JSONs and the Texture are not loading and the looks weird in my head and in the World.

Here is a link to the Repo. This is meant to be a test Mod.

Is there somebody who can help? If so Thanks in advance. Also if there are questions please feel ask.

 

Chris

Link to comment
Share on other sites

Your registry event method (the one that's actually registered) does nothing:

    @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents {
        @SubscribeEvent
        public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
            // register a new block here
            LOGGER.info("HELLO from Register Block");
        }
    }

The one that actually does something, isn't registered as an event handler:

public static void registerAll(RegistryEvent.Register<Block> event) {
        // Verify we are getting the correct registry event. If not, just silently return.
        if (!event.getName().equals(ForgeRegistries.BLOCKS.getRegistryName())) {
            return;
        }

        // This could be on one line, I typically break before each chained method call on
        // Block.Properties. You can break up the line however you like. If extending a block class,
        // I usually create the Properties in the new class' constructor, instead of here.
        blueStone = register("blue_stone", new Block(Block.Properties.create(Material.ROCK)
                .hardnessAndResistance(1.5f, 6f)
                .sound(SoundType.STONE)
        ));
    }

 

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.

Link to comment
Share on other sites

ForgeRegistries.BLOCKS.register(block);

What?

No. Bad modder, no cookie.

 

The whole point of the registry events is that you use event.getRegistry().register(...)

 

Ditto for your ModItems class.

 

Similarly, this is useless:

        if (!event.getName().equals(ForgeRegistries.BLOCKS.getRegistryName())) {
            return;
        }

 

https://bitbucket.org/chriss199815/whatdoiknow/src/b5f75d284115320e57b10671a8c1825fef6f716b/src/main/java/de/chriss1998/wdik/init/ModBlocks.java#lines-79

Use @ObjectHolder do not assign to fields yourself.

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.

Link to comment
Share on other sites

6 hours ago, Draco18s said:

ForgeRegistries.BLOCKS.register(block);

What?

No. Bad modder, no cookie.

 

The whole point of the registry events is that you use event.getRegistry().register(...)

 

Ditto for your ModItems class.

 

Similarly, this is useless:


        if (!event.getName().equals(ForgeRegistries.BLOCKS.getRegistryName())) {
            return;
        }

 

https://bitbucket.org/chriss199815/whatdoiknow/src/b5f75d284115320e57b10671a8c1825fef6f716b/src/main/java/de/chriss1998/wdik/init/ModBlocks.java#lines-79

Use @ObjectHolder do not assign to fields yourself.

Ok, I will look into this but what does that have with the Blockstates? Or is that related to this? 

Edited by chriss1998_15
Link to comment
Share on other sites

If you don't register things the way you're supposed to, when you're supposed to, GOD ONLY KNOWS what'll go wrong.

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.

Link to comment
Share on other sites

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.