Fix Solar panels
This commit is contained in:
parent
123612acb9
commit
fffeb93ff1
2 changed files with 20 additions and 7 deletions
|
@ -73,12 +73,17 @@ public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock
|
|||
@Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY,
|
||||
float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
if(worldIn.canBlockSeeSky(pos.up()) && !worldIn.isRaining() && !worldIn.isThundering()
|
||||
&& worldIn.isDaytime()){
|
||||
return this.getDefaultState().withProperty(ACTIVE, true);
|
||||
if(!worldIn.isRemote)
|
||||
{
|
||||
if (worldIn.canBlockSeeSky(pos.up()) && !worldIn.isRaining() && !worldIn.isThundering() && worldIn.isDaytime())
|
||||
{
|
||||
return this.getDefaultState().withProperty(ACTIVE, true);
|
||||
|
||||
}else{
|
||||
return this.getDefaultState().withProperty(ACTIVE, false);
|
||||
} else
|
||||
{
|
||||
return this.getDefaultState().withProperty(ACTIVE, false);
|
||||
}
|
||||
}else{return this.getDefaultState().withProperty(ACTIVE, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue