#[Solved] BlockRenderLayerMap doesn't seem to exists

17 messages · Page 1 of 1 (latest)

teal geyser
#

Im working on a 1.21.11 mod to backport some of the features from 26.1. I added the golden dandelion which currently isn't rendering correctly as there isn't any transparency. I followed the fabric docs which said to add BlockRenderLayerMap.putBlock(ExampleModAppearance.WAXCAP_BLOCK, ChunkSectionLayer.CUTOUT); in the client init which i did, no errors in my IDE but when i launch the game with runClient i get the following error (See message below) and im not sure how to fix it.

public class Backport261Client implements ClientModInitializer {
    @Override
    public void onInitializeClient() {
        BlockRenderLayerMap.putBlock(ModBlocks.GOLDEN_DANDELION, ChunkSectionLayer.CUTOUT);
    }
}
#
Backport261Client.java:5: error: package net.fabricmc.fabric.api.client.rendering.v1 does not exist
import net.fabricmc.fabric.api.client.rendering.v1.BlockRenderLayerMap;
                                                  ^
/home/bjtmastermind/Documents/Programming/Java/Minecraft Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/src/main/java/me/bjtmastermind/backport_261/Backport261Client.java:6: error: package net.minecraft.client.renderer.chunk does not exist
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
                                          ^
/home/bjtmastermind/Documents/Programming/Java/Minecraft Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/src/main/java/me/bjtmastermind/backport_261/Backport261Client.java:12: error: cannot find symbol
        BlockRenderLayerMap.putBlock(ModBlocks.GOLDEN_DANDELION, ChunkSectionLayer.CUTOUT);
                                                                 ^
  symbol:   variable ChunkSectionLayer
  location: class Backport261Client
/home/bjtmastermind/Documents/Programming/Java/Minecraft Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/src/main/java/me/bjtmastermind/backport_261/Backport261Client.java:12: error: cannot find symbol
        BlockRenderLayerMap.putBlock(ModBlocks.GOLDEN_DANDELION, ChunkSectionLayer.CUTOUT);
        ^
  symbol:   variable BlockRenderLayerMap
  location: class Backport261Client
4 errors
#
[Incubating] Problems report is available at: file:///home/bjtmastermind/Documents/Programming/Java/Minecraft%20Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler output below.
  /home/bjtmastermind/Documents/Programming/Java/Minecraft Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/src/main/java/me/bjtmastermind/backport_261/Backport261Client.java:12: error: cannot find symbol
          BlockRenderLayerMap.putBlock(ModBlocks.GOLDEN_DANDELION, ChunkSectionLayer.CUTOUT);
                                                                   ^
    symbol:   variable ChunkSectionLayer
    location: class Backport261Client
  /home/bjtmastermind/Documents/Programming/Java/Minecraft Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/src/main/java/me/bjtmastermind/backport_261/Backport261Client.java:12: error: cannot find symbol
          BlockRenderLayerMap.putBlock(ModBlocks.GOLDEN_DANDELION, ChunkSectionLayer.CUTOUT);
          ^
    symbol:   variable BlockRenderLayerMap
    location: class Backport261Client
  /home/bjtmastermind/Documents/Programming/Java/Minecraft Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/src/main/java/me/bjtmastermind/backport_261/Backport261Client.java:5: error: package net.fabricmc.fabric.api.client.rendering.v1 does not exist
  import net.fabricmc.fabric.api.client.rendering.v1.BlockRenderLayerMap;
                                                    ^
  /home/bjtmastermind/Documents/Programming/Java/Minecraft Mods/1.20-1.21.11/1.21.11/fabric/26.1-backport/src/main/java/me/bjtmastermind/backport_261/Backport261Client.java:6: error: package net.minecraft.client.renderer.chunk does not exist
  import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
                                            ^
  4 errors
#

I have tried running ./gradlew --refresh-dependencies - it completes successfully but still produces this error when launching.
I have also tried downgrading loom to 1.14 and 1.13 also with no changes.

jovial crypt
#

Do you have the right version of fabric api?

teal geyser
#

i believe so. im using 0.141.3+1.21.11, and fabric 0.18.4

jovial crypt
#

Can you import anything else from fabric api?

teal geyser
#

haven't got too much right now. but the ModInitializer and ClientModInitalizer work

jovial crypt
#

Those are fabric loader not fabric api I believe

teal geyser
#

The ServerChunkEvents event class works

jovial crypt
#

Are you using split sources?

teal geyser
#

no, I just have a different class for client init stuff.

#

oh wait, that might be it. The build.gradle was set to split source. after disabling split source in the build.gradle it worked.

jovial crypt
#

Ah great

teal geyser
#

thanks for the help. I didn't even think about that it could of been that.

#

[Solved] BlockRenderLayerMap doesn't seem to exists

river jacinth