forked from GregTechCEu/gregicality-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGAOreItemBlock.java
More file actions
28 lines (23 loc) · 1.02 KB
/
GAOreItemBlock.java
File metadata and controls
28 lines (23 loc) · 1.02 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
package gregicadditions.blocks;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.api.unification.ore.StoneType;
import gregtech.common.blocks.OreItemBlock;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class GAOreItemBlock extends OreItemBlock {
private GABlockOre oreBlock;
public GAOreItemBlock(GABlockOre oreBlock) {
super(oreBlock);
this.oreBlock = oreBlock;
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
IBlockState blockState = getBlockState(stack);
StoneType stoneType = blockState.getValue(oreBlock.STONE_TYPE);
OrePrefix orePrefix = stoneType.processingPrefix == OrePrefix.ore ? oreBlock.getOrePrefix() :
OrePrefix.valueOf(oreBlock.getOrePrefix().name() + stoneType.processingPrefix.name().substring(3));
return orePrefix.getLocalNameForItem(oreBlock.material);
}
}