-
Notifications
You must be signed in to change notification settings - Fork 367
Expand file tree
/
Copy pathLaserPipeBlockItem.java
More file actions
35 lines (28 loc) · 1.1 KB
/
LaserPipeBlockItem.java
File metadata and controls
35 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.gregtechceu.gtceu.common.item;
import com.gregtechceu.gtceu.api.block.PipeBlock;
import com.gregtechceu.gtceu.api.item.PipeBlockItem;
import com.gregtechceu.gtceu.common.block.LaserPipeBlock;
import net.minecraft.client.color.item.ItemColor;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault
public class LaserPipeBlockItem extends PipeBlockItem {
public LaserPipeBlockItem(PipeBlock block, Properties properties) {
super(block, properties);
}
@Override
public LaserPipeBlock getBlock() {
return (LaserPipeBlock) super.getBlock();
}
@OnlyIn(Dist.CLIENT)
public static ItemColor tintColor() {
return (itemStack, index) -> {
if (itemStack.getItem() instanceof LaserPipeBlockItem materialBlockItem) {
return LaserPipeBlock.tintedColor().getColor(materialBlockItem.getBlock().defaultBlockState(), null,
null, index);
}
return -1;
};
}
}