Hi!
I created a light emitting block which works when I'm not using optifine.
After I run it with optifine the block is not emitting any light. Could someone help me how to solve it? Thanks!
public LightModel(Properties properties) {
super(Properties.create(Material.WOOD)
.sound(SoundType.WOOD)
.hardnessAndResistance(3.0f,3.0f)
.notSolid()
);
this.setDefaultState(this.stateContainer.getBaseState().with(LIT, Boolean.valueOf(true)).with(WATERLOGGED, Boolean.valueOf(false)));
}
public int getLightValue(BlockState state, IBlockReader world, BlockPos pos) {
Boolean i = state.get(LIT);
if (i == true) {
return 15;
} else {
return 0;
} }
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
{
if (Screen.hasShiftDown() == true)
{
state = state.func_235896_a_(LIT);
worldIn.setBlockState(pos, state, 10);
} else {
return ActionResultType.PASS;
}
}
return ActionResultType.func_233537_a_(worldIn.isRemote);
}