Skip to content

Commit bd948ca

Browse files
authored
make coil blocks optionally able to use a custom renderer (GregTechCEu#1703)
1 parent 70f10e8 commit bd948ca

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/gregtechceu/gtceu/common/block/CoilBlock.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.gregtechceu.gtceu.utils.GTUtil;
1010

1111
import com.lowdragmc.lowdraglib.Platform;
12+
import com.lowdragmc.lowdraglib.client.renderer.IRenderer;
1213

1314
import net.minecraft.network.chat.Component;
1415
import net.minecraft.resources.ResourceLocation;
@@ -36,13 +37,21 @@ public class CoilBlock extends ActiveBlock {
3637

3738
public ICoilType coilType;
3839

40+
//@formatter:off
3941
public CoilBlock(Properties properties, ICoilType coilType) {
40-
super(properties, Platform.isClient() ? new TextureOverrideRenderer(new ResourceLocation("block/cube_all"),
42+
this(properties, coilType, Platform.isClient() ? new TextureOverrideRenderer(new ResourceLocation("block/cube_all"),
4143
Map.of("all", coilType.getTexture())) : null,
4244
Platform.isClient() ? new TextureOverrideRenderer(GTCEu.id("block/cube_2_layer/all"),
4345
Map.of("bot_all", coilType.getTexture(),
4446
"top_all", new ResourceLocation(coilType.getTexture() + "_bloom"))) :
4547
null);
48+
}
49+
//@formatter:on
50+
51+
@SuppressWarnings("DataFlowIssue")
52+
public CoilBlock(Properties properties, ICoilType coilType,
53+
@Nullable IRenderer renderer, @Nullable IRenderer activeRenderer) {
54+
super(properties, renderer, activeRenderer);
4655
this.coilType = coilType;
4756
}
4857

0 commit comments

Comments
 (0)