-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathBlockSolarPanel.java
More file actions
70 lines (56 loc) · 1.98 KB
/
Copy pathBlockSolarPanel.java
File metadata and controls
70 lines (56 loc) · 1.98 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package supersymmetry.common.blocks;
import gregtech.api.block.IStateHarvestLevel;
import gregtech.api.block.VariantBlock;
import net.minecraft.block.SoundType;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
public class BlockSolarPanel extends VariantBlock<BlockSolarPanel.SolarPanelType> {
public BlockSolarPanel() {
super(net.minecraft.block.material.Material.IRON);
setTranslationKey("solar_panel");
setHardness(-1.0f);
setResistance(1000.0f);
setSoundType(SoundType.METAL);
setHarvestLevel("wrench", 10);
setDefaultState(getState(SolarPanelType.DEFAULT));
}
@Override
public boolean canCreatureSpawn(@NotNull IBlockState state, @NotNull IBlockAccess world, @NotNull BlockPos pos,
@NotNull EntityLiving.SpawnPlacementType type) {
return false;
}
@Override
public boolean isOpaqueCube(@NotNull IBlockState state) {
return false;
}
@NotNull
@Override
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
public enum SolarPanelType implements IStringSerializable, IStateHarvestLevel {
DEFAULT("default", 9);
private final String name;
private final int harvestLevel;
SolarPanelType(String name, int harvestLevel) {
this.name = name;
this.harvestLevel = harvestLevel;
}
@Nonnull
public String getName() {
return this.name;
}
public int getHarvestLevel(IBlockState state) {
return this.harvestLevel;
}
public String getHarvestTool(IBlockState state) {
return "wrench";
}
}
}