Jump to content

Replaced vanilla dirt blocks are invisible


FlyingSpaten

Recommended Posts

Hello,

 

I recently started modding Minecraft and tried to make bocks fall when their weight is not supported.

As a POC I tried to do this with dirt and stone blocks.

So I tried to override those two blocks like this:

 

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents {

        @SubscribeEvent
        public static void onBlockRegistry(RegistryEvent.Register<Block> event) {
            event.getRegistry().registerAll(
                    BlockList.FALLING_DIRT_BLOCK = new FallingBlock(Block.Properties.create(Material.EARTH, MaterialColor.DIRT).hardnessAndResistance(0.5F).sound(SoundType.GROUND)).setRegistryName(Objects.requireNonNull(Blocks.DIRT.getRegistryName())),
                    BlockList.FALLING_STONE_BLOCK = new FallingBlock(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5F, 6.0F)).setRegistryName(Objects.requireNonNull(Blocks.STONE.getRegistryName()))
            );
        }

        @SubscribeEvent
        public static void onItemRegistry(RegistryEvent.Register<Item> event) {
            event.getRegistry().registerAll(
                    ItemList.FALLING_DIRT_ITEM = new BlockItem(BlockList.FALLING_DIRT_BLOCK, new Item.Properties().group(ItemGroup.BUILDING_BLOCKS)).setRegistryName(Objects.requireNonNull(BlockList.FALLING_DIRT_BLOCK.getRegistryName())),
                    ItemList.FALLING_STONE_ITEM = new BlockItem(BlockList.FALLING_STONE_BLOCK, new Item.Properties().group(ItemGroup.BUILDING_BLOCKS)).setRegistryName(Objects.requireNonNull(BlockList.FALLING_STONE_BLOCK.getRegistryName()))
            );
        }
    }

 

For stone blocks it works fine.

The dirt blocks on the other hand pose a problem.

After world generation all dirt blocks seem to be invisible.

I cannot see them but I also cant walk through them.

I attached an PNG to this post where the missing dirt layer(s) can be seen.

 

As I'm an experienced Java-developer I already tried to find my way through the forge classes but I did not find anything useful up until now.

Hope that somebody here can help.

no_dirt_blocks.png

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.