11package gregtech .common .blocks ;
22
3+ import gregtech .api .block .IStateSpawnControl ;
34import gregtech .api .block .VariantBlock ;
45import gregtech .api .items .toolitem .ToolClasses ;
56import gregtech .api .unification .material .Material ;
@@ -51,12 +52,6 @@ protected BlockStateContainer createBlockState() {
5152 return new BlockStateContainer (this , VARIANT );
5253 }
5354
54- @ Override
55- public boolean canCreatureSpawn (@ NotNull IBlockState state , @ NotNull IBlockAccess world , @ NotNull BlockPos pos ,
56- @ NotNull EntityLiving .SpawnPlacementType type ) {
57- return false ;
58- }
59-
6055 @ Override
6156 protected boolean canSilkHarvest () {
6257 return this .stoneVariant == StoneVariant .SMOOTH ;
@@ -69,21 +64,27 @@ public Item getItemDropped(@NotNull IBlockState state, @NotNull Random rand, int
6964 MetaBlocks .STONE_BLOCKS .get (StoneVariant .COBBLE ) : this );
7065 }
7166
72- public enum StoneType implements IStringSerializable {
67+ public enum StoneType implements IStringSerializable , IStateSpawnControl {
7368
7469 BLACK_GRANITE ("black_granite" , MapColor .BLACK ),
7570 RED_GRANITE ("red_granite" , MapColor .RED ),
7671 MARBLE ("marble" , MapColor .QUARTZ ),
7772 BASALT ("basalt" , MapColor .BLACK_STAINED_HARDENED_CLAY ),
78- CONCRETE_LIGHT ("concrete_light" , MapColor .STONE ),
79- CONCRETE_DARK ("concrete_dark" , MapColor .STONE );
73+ CONCRETE_LIGHT ("concrete_light" , MapColor .STONE , false ),
74+ CONCRETE_DARK ("concrete_dark" , MapColor .STONE , false );
8075
8176 private final String name ;
77+ private final boolean allowSpawn ;
8278 public final MapColor mapColor ;
8379
8480 StoneType (@ NotNull String name , @ NotNull MapColor mapColor ) {
81+ this (name , mapColor , true );
82+ }
83+
84+ StoneType (@ NotNull String name , @ NotNull MapColor mapColor , boolean allowSpawn ) {
8585 this .name = name ;
8686 this .mapColor = mapColor ;
87+ this .allowSpawn = allowSpawn ;
8788 }
8889
8990 @ NotNull
@@ -108,6 +109,12 @@ public Material getMaterial() {
108109 case CONCRETE_LIGHT , CONCRETE_DARK -> Materials .Concrete ;
109110 };
110111 }
112+
113+ @ Override
114+ public boolean canCreatureSpawn (@ NotNull IBlockState state , @ NotNull IBlockAccess world , @ NotNull BlockPos pos ,
115+ @ NotNull EntityLiving .SpawnPlacementType type ) {
116+ return this .allowSpawn ;
117+ }
111118 }
112119
113120 public enum StoneVariant {
0 commit comments