Skip to content

Commit

Permalink
fixed canvas compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Jul 19, 2021
1 parent 3d4195d commit 0b7023c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies {
exclude(group: "net.fabricmc.fabric-api")
}
// Canvas
// modCompile "grondag:canvas-mc116:1.0.+"
// modCompileOnly "grondag:canvas-mc117-1.17:1.0.+"
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package net.adventurez.entity.render.feature.layer;

import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.Identifier;

public class ExtraRenderLayer {
public static RenderLayer getGlowing(String string) {
return RenderLayer.getEntityAlpha(new Identifier(string));
if (FabricLoader.getInstance().isModLoaded("canvas")) {
return RenderLayer.getEntityDecal(new Identifier(string));
} else
return RenderLayer.getEntityAlpha(new Identifier(string));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"predicate": {
"materialPredicate": {
"renderLayerName": "entity_glowing"
"renderLayerName": "entity_decal"
}
},
"material": "canvas:emissive_transform"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"predicate": {
"materialPredicate": {
"renderLayerName": "entity_glowing"
"renderLayerName": "entity_decal"
}
},
"material": "canvas:emissive_transform"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"predicate": {
"materialPredicate": {
"renderLayerName": "entity_glowing"
"renderLayerName": "entity_decal"
}
},
"material": "canvas:emissive_transform"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"predicate": {
"materialPredicate": {
"renderLayerName": "entity_glowing"
"renderLayerName": "entity_decal"
}
},
"material": "canvas:emissive_transform"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"predicate": {
"materialPredicate": {
"renderLayerName": "entity_glowing"
"renderLayerName": "entity_decal"
}
},
"material": "canvas:emissive_transform"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"predicate": {
"materialPredicate": {
"renderLayerName": "entity_glowing"
"renderLayerName": "entity_decal"
}
},
"material": "canvas:emissive_transform"
Expand Down

0 comments on commit 0b7023c

Please sign in to comment.